HONG KONG — China summoned India’s ambassador in Beijing to protest Prime Minister Narendra Modi’s visit to a border area claimed by both countries, a reminder that the world’s two most populous countries have yet to resolve vast territorial disputes that have simmered for more than half a century.

On Friday, Mr. Modi visited Arunachal Pradesh, a state in eastern India that borders Tibet to the north, where he opened a new railroad line. A large portion of the Austria-size state is claimed by China, and the two sides fought a border war over the area in 1962.

China viewed Mr. Modi’s visit as an unnecessary provocation, lodging a diplomatic complaint on Friday. On Saturday, the Chinese deputy foreign minister, Liu Zhenmin, called in Ambassador Ashok Kantha, telling the ambassador that the visit “harmed China’s territorial integrity and rights” and “went against the consensus both sides had of properly handling the border issue,” the official Xinhua News Agency reported.

The dispute has its origins a century ago, when British colonial administrators, negotiating with Tibetan officials, set the border between British India and a then-autonomous Tibet at the so-called McMahon Line in the Himalayan mountains. China, which regained control of Tibet in 1950, claims its border lies well to the south of that line.