India had taken a first-innings lead of 121 runs at the break in reply to Sri Lanka's 183 all out.
After Dhawan (134, 271b, 13X4) and Kohli (103, 191b, 11X4) shared a 227-run partnership for the third wicket, India suddenly lost four wickets in quick succession.
At tea, Wriddhiman Saha was unbeaten on 25 and Harbhajan Singh was yet to open his account.
The two also brought up their 200-run partnership for the third wicket off 329 balls. Dhawan was then hit on his head by a bouncer from Nuwan Pradeep (2/70) in the 71st over albeit he was okay to continue his innings.
Also Read
At the other end, Kohli also reached his century in the 74th over off 187 balls, his fourth hundred as skipper in as many Tests.
But thereafter the slide began.
The off-spinner took two wickets in the space of three balls as he sent back Ajinkya Rahane for a duck, out plumb LBW as well. He could have had a third wicket in three overs, but Dhawan was put down in the 78th over at short cover at 122.
While Wriddhiman Saha came into bat at the other end, the left-hander, who had also been dropped once on day one, couldn't carry on much longer. He added another 10 runs to his total and then played on to his stumps off Pradeep in the 88th over, the second one after the new ball had been taken.