The win for the West Indies ended their losing streak of seven consecutive Test series and foiled Sri Lanka's hopes of a first ever series win in the Caribbean.
The entertaining match looked to be heading to an exciting climax on the penaultimate day, Sarwan and Chanderpaul showed all their experience to guide the hosts home on a tricky pitch.
"It was a tremendous effort from two senior guys and I was really happy to see them capitalising on things," Chris Gayle, West Indies captain, said.
"After getting three half centuries in this series, for Sars (Sarwan) to go on and get a century was great and Shiv (Chanderpaul) really stepped up.
|"There was an extra effort out there, we dug a little deeper... "|
West Indies captain
"There was an extra effort out there, we dug a little deeper and the guys really came along to the party."
Sarwan's century was his 10th in Tests but first in nearly two years, with his last coming against India on June 22, 2006.
Sri Lanka made early inroads in their quest for the ten wickets required for victory, with Tillakaratne Dilshan taking a superb catch to dismiss Gayle for 10 when the left-handed opener tried an ambitious drive off a full-length Thilan Thushara delivery.
Chaminda Vaas then trapped debutant Sewnarine Chattergoon LBW for 11 with a ball that swung into the left-hander, reducing the hosts to 24 for 2.
Marlon Samuels and Sarwan added 49 for the third wicket with Sarwan looking in confident touch, striking three well timed boundaries off Thushara, before Vaas struck again.
|"We had a few half-chances but couldn't get the breakthrough."|
Sri Lanka captain
Samuels was caught out by a well-disguised slower delivery and spooned a shot to Malinda Warnapura who took an excellent catch low to the ground.
Chanderpaul and Sarwan batted throughout the afternoon session, with the latter looking confident against Muttiah Muralitharan, using his feet well to counter the spin, while left-hander Chanderpaul played an intelligent supporting role.
"We knew those two were the danger players and they batted really, really well," Mahela Jayawardene, Sri Lanka captain, said.
"We had a few half-chances but couldn't get the breakthrough."
Muralitharan finally dismissed Sarwan, caught bat-pad by Dilshan at silly point, and the West Indies vice-captain was replaced by Devon Smith with just 23 needed for victory.
The victory provides a boost for the hosts ahead of a series of three one-day games against Sri Lanka which begin on Thursday in Port of Spain.
West Indies' next Test series is against Australia with the first match on May 22 in Jamaica.