Prasanna Jayawardene's composed century and a late wicket for Suranga Lakmal damaged England's hopes of starting the international summer with victory in the first npower Test in Cardiff.
After a rain-affected first day, England enjoyed a fine start this morning when Sri Lanka lynchpin Mahela Jayawardene was undone by James Anderson without a run added to the overnight total of 133 for two.
But his namesake's 112, his third Test ton, steered his team to 400 all out and Andrew Strauss fell before the close as England reached stumps on 47 for one.
Stuart Broad endured plenty of frustration before finally claiming his 100th Test wicket, at 24 the second youngest player to do so after Ian Botham, but there was concerning news on Anderson, who did not bowl after complaining of stiffness in his back and side.
Mahela Jayawardene, on his 34th birthday, was the victim of a wonderful inswinger from Anderson in the third over, Strauss completing the dismissal with a fine catch at slip.
Anderson sent down four consecutive maidens to start the day as he moved the ball in both directions at pace.
Having finally conceded a run in his fifth over, Anderson then shipped a first boundary, Samaraweera striking cleanly down the ground.
Opener Tharanga Paranavitana, who had already been floored by Chris Tremlett, eventually fell to the Surrey man for 66 - painstakingly compiled from 61 overs.
Wicketkeeper Prasanna Jayawardene, whose credentials as a number six had been questioned, got off the mark with a shot worthy of a specialist, crunching Broad through mid-on.
Tremlett was twice unlucky not to have Samaraweera caught - on 15 and 23 - and Broad squared up Jayawardene only for the resulting edge to loop between third slip and gully.
Sri Lanka's 200 came up before lunch with a Jayawardene four that owed more to Kevin Pietersen's misfield than the batsman's placement.
Sri Lanka started the afternoon session positively as England paired the off-colour Graeme Swann and the part-timer Jonathan Trott in advance of the new ball.
The 50 partnership came up off 83 balls before Samaraweera's own half-century followed off 72, with eight boundaries along the way.
Trott was milked easily, while both men were willing and able to take on Swann on the sweep.
Anderson soon got things back on track with the new ball, which was just six deliveries old when Samaraweera (58) edged to Swann in the cordon.
England used both of their referrals in the space of two overs after both Broad and Anderson were sure they had trapped Farveez Maharoof lbw.
The danger evaporated a little as another frustrating Sri Lanka partnership developed and Jayawardene became the fourth player of the innings to make 50.
England needed some luck and found it as Maharoof was run out backing up at the non-striker's end when the bowler, Trott, got a finger on Jayawardene's straight drive.
Broad was short on good fortune for much of the day and saw Thisara Perera edge him for four to third man before the same man survived a tough return chance to Tremlett.
Another opportunity passed by before tea when Jayawardene edged Tremlett just wide of Cook, who had moved from third to fourth slip.
Perera offered another hard catch to Cook, who grassed it at full stretch, to leave Broad despairing.
His long wait for wicket 100 ended when Perera chipped to Tremlett at mid-on, but Jayawardene was still in place and closing in on three figures.
Strauss was guilty of the next drop, Jayawardene on 89 off Swann's bowling, as the edges continued to land safely for Sri Lanka.
The keeper breezed through the nineties before easing to his century with a clip through mid-wicket.
The last three wickets fell for three runs as England belatedly found their ruthless streak, Rangana Herath (25) and Lakmal (two) both out to Swann either side of Jayawardene.
He was caught at the wicket off Broad for a vital 112, but not before seeing his side to 400.
A Strauss four past gully brought England's first runs in reply and Cook was also quickly off the mark, courtesy of an inside edge into the leg side.
After seven innocuous overs with the new ball, captain Tillakaratne Dilshan brought himself on ahead of his two frontline spinners.
Strauss responded by taking six runs off the over, including a second boundary of the innings.
There was little discernible movement to concern the left-handed pairing, who coasted along to 37 from 15 overs.
But Lakmal surprised Strauss (20) with a testing delivery that ended in Mahela Jayawardene's hands at slip.
Anderson was sent out as nightwatchman despite his early departure from the field and closed out the final over as required.Reuse content