Johnson's trip to Abu Dhabi and Riyadh was aimed at securing oil supplies and raising pressure on President Vladimir Putin over Russia's invasion of Ukraine, which led to sweeping Western sanctions on Moscow and soaring world energy prices.
Johnson's office said that in his meeting with Abu Dhabi Crown Prince Sheikh Mohammed bin Zayed al-Nahyan, he stressed the need to work together to stabilise global energy markets.
After his talks in Riyadh with Saudi Arabia's Crown Prince Mohammed bin Salman, Johnson was asked whether the kingdom would increase oil production.
"I think you'd need to talk to the Saudis about that. But I think there was an understanding of the need to ensure stability in global oil markets and gas markets," he said.
So far Saudi Arabia and the UAE, whose close ties with Washington are under strain, have snubbed U.S. pleas to ramp up oil production to tame the rise in crude prices that threatens global recession after the Russian offensive in Ukraine.
"The world must wean itself off Russian hydrocarbons and starve Putin's addiction to oil and gas," Johnson said before his meetings. "Saudi Arabia and the United Arab Emirates are key international partners in that effort."
The two Gulf states are among the few OPEC oil exporters with spare oil capacity to raise output and potentially offset supply losses from Russia. But they have tried to steer a neutral stance between Western allies and Moscow, their partner in an oil producers' grouping known as OPEC+.
The group has been raising output gradually each month by 400,000 barrels a day, resisting pressure to act more quickly.
The UAE remains committed to the OPEC+ deal, a source with knowledge of the matter told Reuters before the meeting.
It has deepened ties with Moscow and Beijing in the last few years and abstained last month in a U.S.-drafted United Nations Security Council resolution to condemn the invasion of Ukraine, which Russia has described as a "special military operation".
Johnson "set out his deep concerns about the chaos unleashed by Russia’s unprovoked invasion, and stressed the importance of working together to improve stability in the global energy market", his office said after his talks in Abu Dhabi.
Johnson and the crown prince also agreed on the need to bolster security, defence and intelligence cooperation to counter threats including from Houthi forces who have fought a lengthy conflict in Yemen against Saudi and UAE forces.
Johnson is only the second major Western leader to visit Saudi Arabia since journalist Jamal Khashoggi's 2018 killing by Saudi government agents in Istanbul.
The CIA concluded that the prince approved an operation to "capture or kill" Khashoggi. He has denied any involvement in the killing.
The prime minister's trip also came just four days after Saudi Arabia executed 81 men, the largest number in a single day for decades, for offences ranging from joining militant groups to holding "deviant beliefs".
Asked about criticism of Saudi Arabia's human rights record, Johnson said: "I've raised all those issues many, many times over the past ... and I'll raise them all again today.
"But we have long, long standing relationships with this part of the world and we need to recognise the very important relationship that we have ... and not just in hydrocarbons."
Saudi press agency SPA said Johnson and Prince Mohammed discussed the conflict in Ukraine and international issues, adding that Saudi Arabia and the United Kingdom signed a memorandum of understanding to establish a strategic partnership.