Chinese Foreign Minister Wang Yi, in separate meetings with Iranian and Saudi national security officials in Beijing on Monday, said all parties in the Middle East conflict should focus on political solutions rather than resorting to arms again.
China, which is pressing for a bigger diplomatic role in the Middle East, also announced that its special envoy would visit Iran, Oman and Saudi Arabia this month.
Wang told Ali Bagheri Kani, deputy secretary of Iran's Supreme National Security Council, that dialogue and negotiation were the way to resolve conflicts in the region, according to the Chinese state news agency Xinhua.
Wang also said China supported Iran's sovereignty and security.
After talks with the national security adviser of Saudi Arabia, Musaed bin Mohammed Al-Aiban, Wang said the regional situation "has again reached a critical crossroads between war and peace."
China "hopes that all parties can resolve differences and end hostilities through dialogue and negotiations, and safeguard the region's energy and shipping lane security", he said.
Al-Aiban passed on a letter from Saudi Crown Prince Mohammed bin Salman addressed to Chinese President Xi Jinping, the Chinese Foreign Ministry said.
It was not immediately clear whether the Iranian and Saudi officials had any contact with each other in Beijing.
Earlier, Xi told Omani leader Sultan Haitham bin Tariq al-Said that the Middle East and Gulf region should not become a battleground for great-power rivalry.
In a joint statement that followed, the sultan said Oman supported Chinese peace proposals for the Middle East, and looked forward to a "greater role" by Beijing in achieving lasting stability.
Reporting by Liz Lee and Beijing newsroom