NEW DELHI, JUNE 10 -- India today agreed to lift severe economic sanctions against the landlocked mountain nation of Nepal after the new Nepalese prime minister distanced himself from China and promised to protect India's security interests.

The agreement, which is expected to be ratified in a formal treaty later this year, marks the end of a bitter three-year dispute between India and Nepal over trade, arms supplies and security matters. Steps taken by India during the dispute badly damaged Nepal's economy and partly fueled the popular resentments there that led to a democratic revolution against King Birendra two months ago.

At a time of escalating tension along India's western frontier with Pakistan, the agreement will provide both psychological and practical relief to India along its northern border, where India fought a war with China in 1962. India has recently shifted some military units from the north and east to its border with Pakistan.

A joint communique issued here this evening after three days of talks between Indian Prime Minister Vishwanath Pratap Singh and Krishna Prasad Bhattarai, the interim Nepali prime minister installed after the April revolution, said the two countries had agreed to restore full trade and transit arrangements by July 1. Most commercial land routes into Nepal have been blocked since March 1989, when a trade treaty between the two countries lapsed and negotiations for a new one collapsed.

The statement also said India and Nepal agreed that they would consult in the future on any defense-related matters that either country viewed as a threat. At a press conference, Bhattarai said Nepal would "take care of Indian susceptibilities on matters of security" and would not allow its territory to be used as a base for activities directed against India.

Before arriving in New Delhi, Bhattarai announced that he had delayed indefinitely Nepal's receipt of a shipment of arms and military supplies from China, signaling that the new prime minister was prepared to return Nepal to its formerly close alliance with India.

The dispute between India and Nepal began several years ago when Nepal, without consulting India, acquired weapons from China. The move was seen as an attempt by King Birendra to protect Nepal's independence by playing off India and China, the two regional powers that surround the kingdom.

Birendra felt compelled to swing toward China, Nepali officials said, because in recent years several neighboring independent kingdoms such as Bhutan and Sikkim had been absorbed by India or had fallen completely under Indian influence.

Birendra's gambit largely backfired when India allowed the trade treaty with Nepal to lapse about 14 months ago. The virtual blockade of Nepal that followed caused severe economic hardships, including shortages of oil, kerosene and some foods.