NEW DELHI — The leaders of India and Italy held talks Monday and signed a slew of agreements that mark a thaw in their relations following the fatal 2012 shootings of two Indian fishermen by Italian marines who mistook them for pirates.

Talks between Italian Prime Minister Paolo Gentiloni and his Indian counterpart, Narendra Modi, covered a wide range of topics, including ways to deepen bilateral economic and political relations.

Officials from the two sides signed six agreements to boost energy security, bilateral trade and cooperation in railway technology.

The talks also covered cyber security and the threat posed by international terrorism, Indian officials said.

With Gentiloni’s visit, India and Italy have cast aside their strained relations of the past five years.

Soon after the 2012 incident, India arrested the two Italian marines for killing the two fishermen in Indian waters while they were assigned to anti-piracy duties aboard an Italian commercial ship. Italy said the marines thought the fishermen were pirates.

The two countries disagreed on the facts of the killing of the fishermen and who has jurisdiction in the case.

The two Italian marines await the decision, expected by about 2018, of an arbitration court in The Hague on whether their trial should be in Italy or in India.