(CNN) It should have been a good-natured exchange between the leaders of two firm allies. But a now-notorious phone call between US President Donald Trump and Australian Prime Minister Malcolm Turnbull has turned into a diplomatic headache for both sides.

A transcript, published by the Washington Post on Thursday , shows Trump and Turnbull battling over a refugee-swap deal made between the Obama administration and Australia. A frustrated Trump even said he had a more pleasant call earlier with Russian President Vladimir Putin.

The account also shows Turnbull almost begging Trump to take 1,250 to 2,000 refugees off Australia's hands, yet apparently suggesting that the deal didn't commit the US to taking any of them.

Burned by the revelation of the transcript, Turnbull on Friday said he was merely "standing up" for Australia. The White House said it would not comment on the leak.

The phone call was made just after Trump took office, and the US President was fuming at Turnbull over the deal, which contradicts his election promise to ban people arriving in the US from Muslim-majority nations and to suspend the country's intake of refugees. News reports had already suggested the call didn't go well.

Turnbull is forced repeatedly to explain the details and significance of the deal to Trump, who says it will make him look like "a dope".

Turnbull tried to reassure the rattled President that each refugee would be subject to US vetting, and that the US could refuse anyone it chose to.

"I am the world's greatest person that does not want to let people into the country. And now I am agreeing to take 2,000 people and I agree I can vet them, but that puts me in a bad position. It makes me look so bad and I have only been here a week," Trump said.

"This is a big deal," Turnbull responded. "It is really, really important to us that we maintain it. It does not oblige you to take one person that you do not want,"

Towards the end of the call, Trump appeared to concede that he would stick to the deal, but he said he would tell the American people that "I hate it."

"I have had it. I have been making these calls all day and this is the most unpleasant call all day. Putin was a pleasant call. This is ridiculous," Trump said shortly before the call ended.

No refugees have yet been transferred to the US under the deal.

'Fake news' claim debunked

Turnbull faced sharp criticism in Australia on Friday for telling Trump that he could refuse refugees.

"It has always been subject to American vetting procedures. That's always been part of the arrangement," he told reporters.

Turnbull also brushed off suggestions of a rift between the US and Australia, maintaining that the call was "frank" and "courteous."

"As President Trump said we're both adults and I stand up for Australia's interests and he stands up for America's interest," Turnbull said.

But the spiky call contradicts the two leaders' earlier accounts that the call had been cordial. Trump had described the conversation as "very civil" and dismissed media reports describing the call as strained as "fake news."

Thank you to Prime Minister of Australia for telling the truth about our very civil conversation that FAKE NEWS media lied about. Very nice! — Donald J. Trump (@realDonaldTrump) February 3, 2017

Trump: 'You are worse than I am'

The deal relates to refugees held in Australia's notorious offshore detention centers on the Pacific island of Nauru and Papua New Guinea's Manus island.

Australia detains asylum-seekers who try to come to the country by boat at these centers, arguing the policy works as a deterrent for people to make the perilous journey by sea to the country, which has resulted in thousands of deaths.

When Turnbull explained this to Trump, the US leaders said that it was "a good idea."

"We should do that too. You are worse than I am," Trump said.

But even Trump could not quite grasp Australia's controversial refugee policy or why it detains asylum-seekers.

"I hate taking these people. I guarantee you they are bad. That is why they are in prison right now. They are not going to be wonderful people who go on to work for the local milk people," Trump said.

When Turnbull tried to respond, Trump interjected. "Well, maybe you should let them out of prison."

The arrival of refugees by boat is a highly politicized issue in Australia, and the deal with the US was celebrated as a major political victory by Turnbull's Liberal Party -- Australia's conservative party, which rules in a coalition. It would be a significant political loss if the deal were to fall through.

Earlier this year, Papua New Guinea's Supreme Court ruled the Manus center unconstitutional, and said it would be closed. Last month, Australia confirmed the center would close by October 31, reiterating that none of Manus' detainees would ever be allowed to settled in Australia.

Turnbull mocks Trump

Turnbull said that it would be better if the call had remained confidential. But he himself is no stranger to leaks.

Turnbull mocked Trump in a speech in June to a gathered crowd of journalists and politicians during the Australian Parliament's boozy annual Midwinter Ball, an event that is usually off the record.

In leaked audio aired by Australia's Channel Nine, Turnbull poked fun at his own efforts to ingratiate himself with the new US President during a meeting in New York.

"It was beautiful. It was the most beautiful putting-me-at-ease ever," he told the crowd, impersonating the US leader.

"The Donald and I, we are winning and winning in the polls. We are winning so much! We are winning like we have never won before."