Prime Minister Narendra Modi and Spanish President Mariano Rajoy on Wednesday stressed the importance of resolving the disputes in the strategic South China Sea in accordance with the universally recognised principles of international law, a statement that could anger China.

In a joint statement after their wide-ranging talks, the two leaders reiterated their commitment to the freedom of navigation and overflight and unimpeded commerce based on the principles of international law, as reflected in the United Nations Convention on the Law of the Sea (UNCLOS).

They urged all parties to resolve disputes "through peaceful means without resorting to threat or use of force, exercise self-restraint in the conduct of activities, and avoid unilateral actions that raise tensions."

Regarding the South China Sea, the two Heads of Government stressed the importance of resolving the disputes in accordance with the universally recognised principles of international law, including the UNCLOS.

While in Germany, Modi and Chancellor Angela Merkel had also touched upon the issue of freedom of navigation in international waters. However, the two leaders had not specifically mentioned the South China Sea issue.

"Both sides underlined the importance of freedom of navigation in international waters, the right of passage and other maritime rights and obligations in accordance with the UN Convention on the Law of the Sea and other principles of international law. Both Leaders attached particular importance to security, stability, connectivity and sustainable development of the blue economy in the Indian Ocean Region," a joint statement issued by India and Germany had said in Berlin.

Both Leaders attached particular importance to security, stability, connectivity and sustainable development of the blue economy in the Indian Ocean Region," a joint statement issued by India and Germany had said in Berlin.

China claims sovereignty over all of South China Sea while Vietnam, Malaysia, the Philippines, Brunei, and Taiwan have counter claims.

China is engaged in hotly contested territorial disputes in both the South China Sea and the East China Sea. Beijing has built up and militarised many of the islands and reefs it controls in the region.

Both areas are stated to be rich in minerals, oil, and other natural resources. They are also vital to global trade.