He spoke to Haitham bin Tarik, the Sultan of Oman, on Tuesday afternoon, Downing Street said.
Ms Zaghari-Ratcliffe and Mr Ashoori, 67, a retired engineer, returned to the UK last week after the British government paid off a debt of nearly £400 million ($523m) to Iran.
“The prime minister spoke to the Sultan of Oman, Haitham bin Tarik Al Said, this afternoon,” a UK government spokesperson said.
“He thanked the Sultan and the government of Oman for their invaluable assistance in securing the release of British nationals Nazanin Zaghari-Ratcliffe and Anoosheh Ashouri from Iran, highlighting it as an example of the UK and Oman’s successful and enduring partnership.”
The release of a third prisoner, Morad Tahbaz, is also understood to have been part of the deal but he was banned from leaving Iran.
Ms Zaghari-Ratcliffe, 43, was arrested in April 2016 and spent four years behind bars before she was released from Evin jail. She spent another two years under effective house arrest, unable to leave the country until the deal between Britain and Iran was concluded.
Mr Ashouri was arrested by Iranian authorities in August 2017 during a visit to his homeland to see his mother. In August 2019, he was sentenced to 12 years in prison on spying charges.
Their freedom came as world leaders try to negotiate the return of both Iran and the US to a 2015 deal that limits Tehran's nuclear programme while lifting sanctions.
Since she returned home last week, Ms Zaghari-Ratcliffe has spoken of her pleasure at braiding and brushing her daughter's hair.
“I shouldn't have been in prison for six years,” said Ms Zaghari-Ratcliffe. “I think I think we have we have gone through a lot. It has been a tough journey.
“Coming back was also very tough … coming back to a daughter who is nearly eight, I left her when she was not even two.”
Reflecting on her return to the UK, she said she was “overwhelmed” when she landed.
Richard Ratcliffe, who led a campaign for his wife’s freedom, paid tribute to her during a press conference on Monday after what he said was “a long struggle”.
Mr Ratcliffe thanked everyone for “making us whole again” and said it is “nice to be retiring” from his campaigning.
The UK and Oman leaders, in their meeting, also shared concerns over the war in Ukraine and the conflict in Yemen.
“The leaders shared their deep concerns about the brutal Russian offensive in Ukraine, agreeing that attacks on civilians must be stopped,” the UK spokesperson said.
“They discussed efforts to improve global energy security in the wake of the crisis, including by boosting our existing cooperation in renewable energy and green technology."