Updated

Indian Prime Minister Narendra Modi wooed his country's tiny Himalayan neighbor, Nepal, during a two-day visit aimed at boosting ties with a country that India has long ignored and where China already has a strong presence.

In the first visit by an Indian prime minister in 17 years, Modi addressed parliament, speaking briefly in the Nepali language, and stopped to meet delighted crowds. He offered $1 billion in low-interest development loans and visited a revered Hindu shrine.

While China has built power plants, highways, an airport and telecommunication facilities and given airplanes to Nepal, India has made promises in the past but has not always delivered.

Analysts said the visit, which ended Monday, hit many of the right notes.

"This was the most successful trip by any Indian leader to Nepal," said Dhurba Hari Adhikary, an independent analyst.

"There has been a big gap of 17 years, so people here in Nepal felt they were not being considered a good friend for quite a while," Adhikary said. "This gap has been breached."

Thousands of people lined the road to cheer as Modi's motorcade passed. At one point, he stopped his armored car to get out and shake hands with the onlookers. The footage, recorded by people on their cellphones, was quickly posted on social media sites.

Modi met with the prime minister, the president and other leaders, and visited Pasupatinath, a temple for the Hindu God Shiva.

Modi, a devout Hindu, offered prayers and presented the temple with 2,500 kilograms (5,500 pounds) of sandalwood worth 30 million rupees ($306,000) to be used for rituals.

In his speech at the Constituent Assembly, he promised to aid Nepal's economy and offered $1 billion in loans for development, including hydropower plants in the energy-starved Himalayan nation.

Millions of people in Nepal face up to 12 hours of power outages each day because of an inadequate number of power plants.

"After hearing his speech in parliament I have become Modi's fan. I am convinced he will regard us in Nepal as equal partners and not treat us like someone inferior as past Indian leaders did," said Shyam Karki, a garment trader who often visits India.

There was some disappointment, however, that a proposed electricity trading agreement between India and Nepal did not materialize.

No reason was given for the delay, but officials said there was still work to be done on the details.

"It was disappointing that India did not even want to discuss the power trading agreement draft that Nepal had sent during Modi's visit," said Ameet Dhakal, editor of the popular online news portal Setopati.