Kumar Sangakkara scored a world record equalling half century as Sri Lanka reached 214-4 at the end of the third day to leave the second Test against England delicately poised.
The stylish Sangakkara became only the fourth player in Test history to score seven successive half centuries as Sri Lanka threatened to seize control but he fell for 55 as England took two late wickets to stall the visitors' progress.
Having earlier polished off England's first innings for 365, Sri Lanka ended the day 106 runs ahead.
Sangakkara, who joined Everton Weekes, Shivnarine Chanderpaul and former England coach Andy Flower to score seven consecutive Test half 50s, shared a 79-wicket third-wicket partnership with Mahela Jayawardene (55 not out).
With England desperate to break the partnership, captain Alastair Cook turned to Moeen and the change of bowling brought about immediate rewards as he had Sangakkara trapped lbw for 55.
Within minutes Moeen had his second wicket, beating Lahiru Thirimanne with a ball that spun past the batsman's tentative prod to remove his bails for a second duck of the match.
England continued to press but the determined Jayawardene reached his 48th Test match 50.
Sri Lanka negotiated the final 45 minutes of the day without any more setbacks, but only after surviving reviews from both Ali and Liam Plunkett who himself had taken two wickets in the afternoon session.
The first Test of the two-match series ended in a draw at Lord's last week.