Chinese President Xi Jinping urged Middle Eastern countries on Wednesday to oppose "external interference" and said Beijing was ready to work with regional states to safeguard maritime shipping, jeopardised by the US-Iran war.

Xi's remarks to his Egyptian counterpart Abdel Fattah al-Sisi, on his first visit to Cairo in a decade, come as Beijing seeks a greater foothold in the region, expanding investment while managing fallout from the six-month conflict.

"We must uphold the principle that the people of the Middle East are the masters of their own affairs, oppose external interference (and) support regional countries in strengthening dialogue on peace and security," Xi said in a meeting with Sisi, according to Chinese state news agency Xinhua.

Xi was greeted by Sisi and a 21-gun salute at Cairo's Ittihadiya presidential palace before holding talks that focused on the US-Iran conflict, with both leaders calling for "diplomatic solutions" and a "comprehensive agreement to end the war", according to a statement from Sisi's office.

Across Cairo, a sprawling metropolis of more than 26 million people, Chinese and Egyptian flags lined major thoroughfares alongside billboards featuring Sisi and Xi as the Chinese president later visited the Grand Egyptian Museum near the Giza Pyramids.