Angelo Mathews lifted Sri Lanka out of trouble with a superb century on day one of the second Test against England.

A collapse to 135 all out in their first innings was the main cause of Sri Lanka's defeat in last week's first game of the two-match rubber and they found themselves in early strife once more in Galle.

James Anderson (3-24) returned to lead the England attack and removed Kusal Perera and Oshada Fernando, the latter for nought, to leave the hosts 7-2.

But Mathews (107 not out) made the most of favourable batting conditions to lay the foundations for an imposing total, finding willing allies in Lahiru Thirimanne (43) and captain Dinesh Chandimal (52) and leading a recovery to 229-4 at stumps.

England's attack toiled hard after Joe Root lost the toss but they caused problems early on, with Sam Curran having a huge lbw shout against Kusal in the second over before Anderson added to his 600 Test wickets.

Recalled in place of long-time new ball partner Stuart Broad as England juggled their seam options with an eye on their forthcoming tour of India, Anderson persuaded Kusal into a ludicrously expansive hack that he edged to Root at slip.

Oshada was recalled to the Sri Lanka side after four ducks in five innings for Kusal Mendis, only to suffer the same fate as he edged a lifting delivery onto his stumps.

Thirimanne scored a century in the first Test, although his fine form was ultimately insufficient to repel his nemesis Anderson, who moved a ball beautifully away to encourage an edge behind and dismiss the opener for an eighth time in Tests.

Sri Lanka were 76-3 shortly after lunch at that stage. Mathews' alliance with Chandimal was certainly timely and they were able to milk England spin due Jack Leach and Dom Bess with minimal risk.

Paceman Mark Wood was the only bowler to offer sustained discomfort to each, both mentally and physically as he frequently touched 90 mph.

The over after Anderson fumbled a run-out chance at mid-on, Wood had his reward - pinning Chandimal with an in-swinger the batsman's review showed was thundering into leg stump.

Unperturbed by the end of that 117-run stand, Mathews brought up an 11th Test ton with a single off Leach and will resume alongside Niroshan Dickwella (19 not out) in the hope of kicking on to something even more substantial.

Evergreen Anderson produces another under-stated masterclass

Anderson being rotated with Broad for Tests in these conditions makes sound tactical sense but also reminds us the end of an era is edging closer.

Not that the Lancastrian looked remotely close to retirement as he hit immaculate lines and lengths from the off, putting paid to Sri Lanka's top order. Late in the day, he also found some reverse swing to keep the imperious Mathews on his toes. Truly a master craftsman at work.

Angelo shows Sri Lanka the way to go

Mathews paid tribute to the England attack for giving nothing away in a close-of-play interview.

The same praise could be applied to his economically compiled century - his first in five years on home soil. His knock was the antithesis of Kusal's morning nonsense. Any risks taken - an airy clip for four over mid-on off Leach was one of 11 boundaries - were very much relative within an intensely disciplined effort.

England spinners offer negligible threat

Leach and Bess each claimed five-wicket hauls in the series-opening win but they wheeled away without reward here, underlining the magnitude of the task that awaits England in India.

Going wicketless on such a flat pitch can happen, but of their 40 combined overs, England's spin twins produced only four maidens between them and went at three runs per over as the early pressure lifted.