MOSCOW (Reuters) - Russian President Vladimir Putin had telephone discussions with the leaders of Qatar and Bahrain, stressing the need for diplomacy to end the dispute between Qatar and several other Arab states, the Kremlin said on Saturday.

Russian President Vladimir Putin attends a meeting with Vietnamese President Tran Dai Quang at the Kremlin in Moscow, Russia June 29, 2017. REUTERS/Natalia Kolesnikova/Pool

Saudi Arabia, Egypt, the United Arab Emirates and Bahrain severed ties with Qatar last month, accusing it of supporting terrorism and opening up the worst rift in years among some of the most powerful states in the Arab world.

Moscow is trying to tread cautiously in the dispute, since it wants good relations with both Qatar and Saudi Arabia.

Russia backs President Bashar al-Assad in the six-year-long Syria conflict and is close to Iran, which has fraught ties with the Saudis.

Moscow sold a stake in its state oil champion Rosneft ROSN.MM to Qatar last year and has been coordinating oil output cuts with the Saudis as part of a global pact to lift oil prices.

The Kremlin, which announced the phone calls with the leaders of Qatar and Bahrain in two separate statements on its website on Saturday, did not say when they happened.

It clarified that they happened on the initiative of Qatar and Bahrain.

“Vladimir Putin stressed the importance of political-diplomatic efforts aimed at overcoming differences of opinion and the normalization of the difficult situation that exists,” said the statement on the talks between Putin and Qatar’s emir, Sheikh Tamim bin Hamad al-Thani.

The Russian and Qatari leaders also discussed cooperation between their countries in energy and investment.

Putin told Bahrain’s King Hamad bin Isa al-Khalifa that there should be direct dialogue between all sides of the dispute with Qatar.

The Kremlin said last month that it was in Russia’s interest for there to be a “stable and peaceful” situation in the Gulf.