China on Wednesday congratulated Indian Prime Minister Narendra Modi following his election win, adding it was "ready to work" with its neighbour.

Both countries have regularly accused each other of trying to seize territory along their unofficial divide, known as the Line of Actual Control, and have clashed a number of times in the region.

A "healthy and stable China-India relationship is in the common interest of both sides and is also conducive to peace and development in the region and the world," foreign ministry spokeswoman Mao Ning told a regular press conference.

"The Chinese side would like to congratulate" Modi's BJP party and his National Democratic Alliance, she added.

Modi is facing the prospects of a far tougher-than-expected third term after his party failed to secure an outright majority for the first time since sweeping to power a decade ago.

The release of the results on Tuesday upended conventional wisdom throughout the six-week election that Modi's Hindu nationalist agenda would power him to a landslide win.

"China is ready to work with India to promote the healthy and stable development of relations between the two countries, in the fundamental interests of the two countries and peoples, with an eye to the big picture and a view to the future," she said.

India has been wary of its northern neighbour's growing military assertiveness and disputes over the two Asian giants' 3,500-kilometre (2,200-mile) shared frontier have been a perennial source of tension.

China claims all of India's northeastern state of Arunachal Pradesh, considering it part of Tibet, and the Asian giants fought a full-scale border war in 1962.

- Border clashes -

A clash in 2020 along the border dividing Tibet from India's state of Ladakh led to a sharp deterioration in relations, with both sides sending major reinforcements to the area.

But both countries in September 2022 began pulling back soldiers from a key flashpoint near that incident after more than a dozen rounds of top-level military talks -- and after a two-year troop standoff.

New Delhi is also concerned over Beijing's increasing presence in the Indian Ocean, seeing the region as firmly within its sphere of influence.

In 2022 it joined Washington in raising security concerns when neighbour Sri Lanka allowed a port visit by a Chinese research vessel accused of spying activities.

India and the United States are both members of the so-called Quad, a security alliance focused on the Indo-Pacific and aimed at providing a more substantive counterweight to China's rising military and economic power.