The news was another blow to injury-ravaged England ahead of the first of three Tests against the tourists starting on May 11 at Lord's.
Simon Jones is also a major doubt after the reverse swing specialist limped off with a knee twinge during Glamorgan's one-day win against Ireland on Monday.
England are also set to be without skipper Michael Vaughan (knee), spearhead fast bowler Steve Harmison (shin) and left-arm spinner Ashley Giles (hip).
The likelihood of Mahmood being named in the Test side increased when he was withdrawn from the England A team's four-day match against Sri Lanka A which is due to get underway on Thursday.
Mahmood will instead play for Lancashire in their county championship match against Kent at Old Trafford from Wednesday and his tactical withdrawal suggests he will join Liam Plunkett, Matthew Hoggard and Andrew Flintoff in the England attack next week.
Chairman of selectors David Graveney said: "Following the injuries to Simon Jones and James Anderson, the selectors have decided to withdraw Sajid Mahmood from the Sri Lanka tour match for tactical reasons as he is in contention to play in next week's first Test.
"Liam Plunkett is also under consideration for the first Test, but he will play for England A as Durham do not have a four-day game this week and this will provide him with further match practice."
With Hampshire's Chris Tremlett, who was also due to play for England A, sidelined with an ankle injury, the selectors have called up Leicestershire fast bowler Stuart Broad, the son of former England opener Chris, and Gloucestershire seamer Jon Lewis to fill in for the A team.
Anderson, who is due to see a specialist on Wednesday, has not played for his county since his return from England's tour of India.
"This is a huge blow for a player who has worked very hard and very long to get back into the one-day international and Test match environment," said Lancashire coach Mike Watkinson.
Jones, 27, has not played for England since the fourth Ashes Test win against Australia at Trent Bridge in August as a result of a combination of ankle and knee injuries.
England are due to name their first Test squad on Sunday.