China and India signed an agreement Wednesday aimed at maintaining peace and stability along the countries' border, where territorial disputes have frequently erupted.

The accord was signed after Chinese Premier Li Keqiang met with Indian counterpart Manmohan Singh at Beijing's Great Hall of the People following a welcome ceremony.

The pact comes just months after New Delhi sparked tensions by accusing Chinese troops of incursions into disputed areas of the Himalayas.

The groundwork for the agreement was laid during Li's visit to India in May, the first trip abroad by the Chinese premier since his election in March.

The countries maintain several border disputes along their 4,000-kilometer (2,485-mile) frontier. While China claims part of the northeastern Indian state of Arunachal Pradesh, India contests Beijing's administration of the Aksai Chin area of Kashmir.

Singh, who arrived in Beijing Tuesday for a four-day visit, also is expected to devote much of his attention to the countries' bilateral trade ties and seek ways to reduce India's nearly $29 billion deficit with China.

In addition, the nations are continuing discussions on a proposed economic corridor linking India and China and also covering Bangladesh and Myanmar.

Li proposed creating that corridor during his visit to New Delhi.

"The relationship between China and India is one of the most important of the 21st century," Li said Wednesday after his meeting with Singh.

It marked the first time since 1954 that the countries' respective prime ministers have exchanged official visits in the same calendar year.

Singh's visit to China coincides with that of his Russian counterpart, Dmitry Medvedev, who met Tuesday with Chinese leaders.