TOKYO – Japan and India have signed a controversial civil nuclear deal that will allow Japanese firms to export atomic technology to the South Asian state.

The pact was signed by Indian Prime Minister Narendra Modi and his Japanese counterpart Shinzo Abe on Friday.

After signing the deal, India became the first non-signatory to the Treaty on the Non-Proliferation of Nuclear Weapons (NPT) to agree such a nuclear deal with Japan – which was the victim of US atomic bombings in the final days of World War II. The two countries are also set to agree that if India conducts a nuclear test, Japan will stop cooperation.

“The agreement is a legal framework to ensure India acts responsibly for the peaceful use of nuclear energy,” Abe told reporters with Modi at his side.

A Japanese official told reporters that the two nations have agreed Japan can cease cooperation if India resumes nuclear testing, a foreign news agency reported.

“Today’s signing of the agreement for cooperation in peaceful use of nuclear energy marks a historic step in our engagement to build a clean energy partnership,” Modi said.

The Asian allies have stepped up cooperation in recent years, signing agreements last December on the transfer of defence equipment and technology and on exchanging classified military information.

The nuclear deal comes against the backdrop of growing unease over China’s expanding role in the region.

India has a longstanding territorial dispute with China, and troops from the two countries engaged in a major stand-off at the border in 2014.

Tokyo has its own spat with Beijing over islands in the East China Sea, and is increasingly vocal about its rival’s ambitions to control almost the whole of the South China Sea.

Modi arrived in Japan on Thursday for a three-day visit.