When Tillakaratne Dilshan reached his century in the second ODI in Pallekele, his celebration seemed like a release of pent-up frustration that had accumulated for months. He had battled for close to 50 overs, some of them with cramps, to carve out a match-winning century after five ordinary scores. His celebration after his century in Galle today was relatively subdued. After sweeping Abdur Rehman to the boundary, there was no war cry or leap, just a simple acknowledgement to his team-mates and the average weekday crowd. Dilshan's modest celebration hid the fact it was his first Test century at home in three years and also the first since he quit the captaincy.

Midway through the one-day series, Dilshan had spoken of how his decision to resign as captain was taken based on his batting form. The fluency of his run making had become sporadic, so he had to take some tough decisions, which meant giving up the leadership to allow him to focus on scoring freely, which is his strength.

Dilshan's century came after a year - his last was his personal best of 193, at Lord's. Since then, he scored three fifties, including 92 against Pakistan last year in Sharjah. Mahela Jayawardene said on the eve of this Test that the opening combination didn't look as settled as the middle order. While Dilshan occupied one slot, his partners like Tharanga Paranavitana and Lahiru Thirimanne have rotated. What the team needed was consistent scores from at least one of them. Dilshan did exactly what his captain had asked for.

His innings in Galle gave Sri Lanka an advantage that they kept through the day. Dilshan wasn't flawless, though. He couldn't resist the urge to slash at deliveries wide outside the off stump. Junaid Khan beat the bat a few times, and almost induced a leading edge with a delivery that bounced a bit more than Dilshan would have liked. In the half hour before lunch, he also survived a few lbw appeals against the spinners. He had release when Junaid came on for a second spell and pitched short on a slow wicket, allowing the freedom to pull.

The turn and bounce in the opening session could have unsettled Sri Lanka after Paranavitana's dismissal, but Dilshan's aggressive style ensured it did not. He raced to 50 off 49 balls. His approach forced the Pakistan captain Mohammad Hafeez to change his fields. Saeed Ajmal, who had settled into a round-the-wicket line, had a rather defensive set up, with three fielders deep on the leg-side. Abdul Rehman had a long-off and a short cover against Dilshan.

Dilshan was more conservative after lunch, setting himself up for a long innings. He gave credit to the bowlers for that. "After lunch, they bowled to their fields, bowling good line and lengths," he said. "That's why I slowed down a bit."

However, Dilshan did not let the pressure of tight lines and close fielders get to him. It helped that he had Kumar Sangakkara, who ended the day unbeaten on 111, for company. The fields for Rehman were unorthodox, because he had a silly mid-off, a long-off and two slips. Dilshan found a way to get past that security cordon, with powerful drives through extra cover.

Ajmal changed ends and returned for a new spell, bowling with the sea breeze. He had a slip, short leg and leg gully in place, and bowled a leg stump line. It didn't work, though, as Dilshan swept past leg gully and sped towards his hundred. It was an innings of three parts - he began aggressively, settled down to respect the bowling and then accelerated as his landmark neared. His last five scoring shots to reach his 13th Test century were boundaries.

The end of day score - 300 for 2 - might suggest Sri Lanka were batting on a featherbed pitch, but Dilshan disagreed. "We expected the pitch to start turning from the second day but it started taking turn from the first session itself," he said. "It was not the easiest wicket to bat on. I thought myself, Mahela and Sanga handled the pressure and bowling unit well."

Dilshan did not carry on after reaching his century, but his approach put Sri Lanka on course for 500.

Kanishkaa Balachandran is a senior sub-editor at ESPNcricinfo