At stumps on day one at Galle International Stadium, the home side posted 321 runs losing four wickets against Bangladesh.
Mendis' brilliant 166 comprised 18 fours and two sixes. Middle-order batsman Asela Gunaratne provided valuable support, scoring 85 from 134 balls with seven boundaries.
Mendis and Gunaratne added 196 runs for the fourth wicket partnership after the Bangladesh pacers bowled economically in the morning session. Bangladesh conceded 61 runs in the first session, taking two wickets.
But after lunch, the Lankans scripted a strong comeback and went on to register a commanding total on the board at the end of the day.
Mustafizur Rahman, Taskin Ahmed, Subashish Roy and Mehedi Hasan Miraz all took a wicket apiece.
Earlier, Lanka captain Rangana Herath won the toss and elected to bat first. It was a good toss to win as the host are on the verge of a big total when play resumes on Wednesday.
Bangladesh made three changes to their playing XI from the Hyderabad Test with Liton Kumar Das, Subashish and Mustafizur included in place of Sabbir Rahman, Taijul Islam and Kamrul Islam Rabbi respectively.
Mustafizur opened the bowling for Bangladesh, alongside Taskin, as Sri Lanka's opening batsmen Upul Tharanga and Dimuth Karunaratne started cautiously.
However, it was Subashish who initiated the first breakthrough in the sixth over. Tharanga was cleaned up by the right-arm paceman for four.
[caption id="attachment_50989" align="aligncenter" width="1024"]
Subashish Roy celebrates after cleaning up opening batsman Upul Tharanga AFP
In the very next ball, new batsman Mendis edged one and Liton took a brilliant catch diving low to his right. But Bangladesh’s celebration proved to be premature as it was discovered that Subashish had overstepped and the delivery was duly declared a no ball.
Mendis utilised his luck perfectly, scoring a brilliant hundred.
Bangladesh's pace bowling trio Mustafizur, Taskin and Subashish bowled well in the pre-lunch session but were unable to break the Lankan resistance. Taskin and Subashish especially bowled with good pace and bounce.
Off-spinner Miraz took the second wicket in the 23rd over. Opener Karunaratne tried to cut a delivery that was outside the off-stump only to drag it onto the stumps. He made 30 runs off 72 deliveries.
All eyes were on Mustafizur as the left-arm pacer made his Test return after August, 2015. He finished the day with figures of 15-3-50-1. He took the vital wicket of Dinesh Chandimal (five). Chandimal had scored an undefeated 190 against Bangladesh during the two-day practice match. Chandimal tried to slash hard against Mustafizur but managed to get a thick outside edge. Miraz took a magnificent catch at gully.
Bangladesh will look to restrict the Lankans as early as possible in the second day as the wicket will deteriorate as the game wears on.
321/4 in 88 overs (Mendis 166*, Gunaratne 85, Taskin 1/48)