GALLE, Sri Lanka (AP) — Spinners Ravichandran Ashwin and Ravindra Jadeja took three wickets each as India defeated Sri Lanka by 304 runs in the opener of a three-match test series at Galle International Stadium on Saturday.

India, batting first, scored 600 in its first innings and bowled Sri Lanka out for 291. India batted again with a 309-run first-innings lead without enforcing the follow-on and declared its second innings on 240 for three.

Set a daunting 550 to win, Sri Lanka, which showed glimpses of a fight, was bowled out for 245. Dimuth Karunaratne fell three runs short of a century as he was involved in two lengthy partnerships with Kusal Mendis and Niroshan Dickwella.

He faced 209 deliveries and hit nine boundaries.

Jadeja returned three for 71 and collected six wickets in the match while Ashwin had the best innings figures of three for 65.

Earlier in the middle session, Jadeja broke a promising 79-run stand for the third wicket between Karunaratne and Mendis (36) when he successfully won a review for an edge from Mendis to the wicketkeeper, Wriddhiman Saha. Angelo Mathews made two before being caught by Hardik Pandya off Jadeja.

Sri Lanka looked to stretch the game into the final day even at tea with Karunaratne and Dickwella standing solid. They shared 101 runs for the fifth wicket before Ashwin had Dickwella caught by Saha for 67 in the fifth over of the final session.

Dickwella faced 94 deliveries and hit 10 boundaries.

The remaining three wickets fell for 28 runs, and two injured players, Asela Gunaratne and stand-in captain Rangana Herath, were unable to bat.

India captain Virat Kohli said it was satisfying to win after his team hadn't played a test match in five months.

"February is (when) we last played test cricket and from then, having played so much one-day cricket and not having the time to prepare so much in between, I think from that point of view, it was good to get back into the groove ... to win a test match."

He added, "I won't say that we don't have areas that we look to improve on ... but very happy with the performance."

Herath said several bad performances led to his team's defeat.

"We bowled badly, fielded badly and batted badly in the first innings," Herath said. "We are a better team than that. ... We need to find out how we can do better than this moving forward."

India was still batting in its second innings on the fourth morning and declared after 30 minutes of batting setting the hosts an uphill task of saving the game.

Kohli had his 17th test century, scoring an unbeaten 103 facing 136 deliveries and hitting five fours and a six. Abhinav Mukund was out for 81 on Friday after he and Kohli shared 133 runs for the third wicket to help India post a big target.

Then India's seam bowlers quickly grabbed the momentum with two wickets.

Mohammed Shami broke through for India in the third over by bowling out Upul Tharanga (10), who'd been dropped by Kohli earlier in the over.

Danushka Gunathilaka flicked a ball from Umesh Yadav straight to Cheteshwar Pujara at midwicket to leave Sri Lanka 29 for two.

India's opening batsman, Shikhar Dhawan, was named player of the match for his score of 190 runs in the first innings.

The second test match will begin in Colombo, Sri Lanka on Aug. 3.