India signed a formal agreement Friday to buy 36 Rafale fighter jets from France’s Dassault for a reported $8.8 billion, one of its biggest defence deals in decades.

India’s Defence Minister Manohar Parrikar and his French counterpart Jean-Yves Le Drian signed the agreement at a ceremony in New Delhi after years of tortuous negotiations between the two countries.

Defence experts say it will bring a much needed boost to India’s air force as it tries to renew its dwindling fleet of Russian MiG-21s ─ dubbed “Flying Coffins” because of their poor safety record.

The world’s top defence importer has signed several big-ticket deals as part of a $100bn upgrade since India’s Hindu nationalist Prime Minister Narendra Modi took power in 2014.

The increasing assertiveness of its giant neighbour China as well as a simmering rivalry with Pakistan have increased India’s need to upgrade its military.

Friday’s agreement is a major vote of confidence in the Rafale, which had long struggled to find buyers overseas, despite heavy lobbying efforts by the administration of French President Francois Hollande.

It was first mooted in 2012 but faced major delays and obstacles over the last four years.

India entered exclusive negotiations on buying 126 Rafale jets four years ago, but the number of planes was scaled back in talks over the cost and assembly of the planes in India.

Modi announced on a visit to Paris last year that his government had agreed in principle to buy the jets as India looks to modernise its Soviet-era military.

But it continued to be held back by disagreements such as Delhi’s insistence that arms makers invest a percentage of the value of any major deal in India, known as the offset clause.

Hollande again pushed the deal on a visit to India in January, when he was Modi’s guest for Republic Day celebrations, but officials privately acknowledged that price had become a sticking point.

It is the biggest order for the Rafale after Egypt agreed to buy 24 of the jets in 2015 and Qatar purchased the same amount later that year.

The highly versatile Rafale is currently being used for bombing missions over Syria and Iraq as part of an international campaign against the militant Islamic State group.

It has also been deployed in the past for air strikes in Libya and Afghanistan.