Ali's century, his second Test hundred, was the cornerstone of England's 498 for nine declared.
At tea, Sri Lanka were 32 for one in reply, a deficit of 466 runs, after Dimuth Karunaratne was bowled round his legs by James Anderson.
Kaushal Silva was nine not out and Kusal Mendis 14 not out.
England's total was especially imposing given Sri Lanka had been dismissed for 91 and 119 during the hosts' innings and 88-run victory in the first Test of this three-match series at Headingley last week.
Having made his name as top-order batsman with Worcestershire, Ali has primarily been deployed by England as an off-spinner.
Often batting as low as No 8, he was promoted to No 7 after all-rounder Ben Stokes was ruled out of this match with a knee injury.
The day before this match started, England captain Alastair Cook said: "I don't think we've seen the best of Mo's batting."
Ali, dropped on 36 and 105, did his best to set his skipper straight as he ran a sloppy Sri Lanka ragged, taking twos even when the field had been pushed back.
Left-hander Ali was 28 not out and Chris Woakes, in for Stokes, eight not out.
Sri Lanka held several brilliant catches on Friday, but Saturday's early overs saw them drop two chances.
Ali fended outside off stump against Nuwan Pradeep but Karunaratne at a wide second slip couldn't hold the shoulder high chance.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
