GOA, India (Reuters) - India and Russia signed billions of dollars of defense and energy deals on Saturday at a summit that sought to inject new life into a relationship that has been tested by shifting global alliances and conflict in the Middle East.

India's Prime Minister Narendra Modi (R) speaks with Russian President Vladimir Putin during exchange of agreements event after India-Russia Annual Summit in Benaulim, in the western state of Goa, India, October 15, 2016. REUTERS/Danish Siddiqui

Under the biggest agreement, a group led by Russian state oil major Rosneft ROSN.MM said it would pay $12.9 billion for a controlling stake in both India's Essar Oil and port facilities that it owns.

The countries, which had strong ties during the Cold War, announced plans for a joint venture to build helicopters in India. New Delhi said it would also buy surface-to-air missile systems and stealth frigates from Moscow.

“Ours is a truly unique and privileged relationship,” Indian Prime Minister Narendra Modi said after talks with Russian President Vladimir Putin in the western seaside state of Goa.

Modi said that his views were aligned with Putin’s on the unstable situation in Afghanistan and the Middle East, where Moscow is at odds with the West in the five-year-old civil war in Syria that has killed hundreds of thousands.

“We are conducting a comprehensive dialog on a wide scale of international issues, in which Indian and Russian approaches are close to each other or coincide,” said Putin.

Modi also praised Putin’s support for the fight against international terrorism, which India accuses its neighbor and rival Pakistan of sponsoring. “Russia’s clear stand on the need to combat terrorism mirrors our own,” Modi said.

MULTIPLE DEALS

The Rosneft-Essar deal will be the biggest foreign takeover in India, and Russia’s largest outbound deal, according to Thomson Reuters data.

It comes as Russia moves to reassert its role in global affairs and at a time when its own economy is stagnant, hit by Western sanctions and low oil prices.

Under the deal, a group led by Rosneft will acquire 98 percent of Essar Oil, and with it a 400,000 barrels-per-day refinery and port at Vadinar for $12.9 billion, the two sides said.

Russian state bank VTB VTBR.MM said it would refinance $3.9 billion owed by the Essar Group. Rosneft would pay $3.5 billion and its partners, oil trader Trafigura and investment fund UCP the same amount for an equal joint stake.

The refinery deal follows a string of upstream investments in Russia by Indian companies in recent months that, Modi said, were worth $5.5 billion.

Slideshow ( 4 images )

Also on display was Russia’s nuclear prowess, with the second reactor of the Russian-built Kudankulam plant in Tamil Nadu hooked up to the grid and concrete being poured in a ceremony carried by a TV linkup to mark the start of work on the third and fourth reactors there.

Putin said that Russia would be able to build a dozen nuclear reactors in India over the next 20 years to back Modi’s growth strategy for Asia’s third-largest economy, which continues to suffer chronic power shortages.

HELICOPTERS, MISSILES, SHIPS

The defense pacts will also deepen military ties between the two countries that dates back to the Soviet era, when India entirely depended on Moscow to equip its armed forces. The United States has since taken over as India’s top arms supplier.

Indian military officials have said the plan is for the joint venture to build at least 200 Kamov 226t helicopters required by the country’s defense forces. Hindustan Aeronautics Ltd will be the local partner of Russian Helicopters and state arms exporter Rosoboronexport.

The S-400 surface-to-air missiles would strengthen India’s defenses along its borders with China and Pakistan, Indian military officials have said. Also agreed were plans to build and supply stealth frigates for the Indian navy.

Russia’s Deputy Prime Minister Dmitry Rogozin, who is in charge of space and military industries, said two frigates could be built in India and two in Russia, RIA news agency reported. Rogozin said the ships may later be equipped with missiles manufactured by BrahMos Aerospace, a venture co-owned by the Indian and Russian governments.