WASHINGTON – President Donald Trump made building a wall along the southern U.S. border and forcing Mexico to pay for it core pledges of his campaign.

But in his first White House call with Mexico's president, Trump described his vow to charge Mexico as a growing political problem, pressuring the Mexican leader to stop saying publicly that his government would never pay.

"You cannot say that to the press," Trump said repeatedly, according to a transcript of the Jan. 27 call obtained by the Washington Post. Trump made clear that he realized the funding would have to come from other sources but threatened to cut off contact if Mexican President Enrique Peña Nieto continued to make defiant statements.

The funding "will work out in the formula somehow," Trump said, adding later that "it will come out in the wash, and that is OK." But "if you are going to say that Mexico is not going to pay for the wall, then I do not want to meet with you guys anymore because I cannot live with that."

The heated exchange came during back-to-back days of calls that Trump held with foreign leaders a week after taking office. The Post did not explain how it obtained transcripts of Trump's talks with Peña Nieto and Australian Prime Minister Malcolm Turnbull.

The Jan. 28 call with Turnbull became particularly acrimonious. "I have had it," Trump said after the two argued about a refugee agreement. "I have been making these calls all day, and this is the most unpleasant."

Before ending the call, Trump said, "Putin was a pleasant call," referring to Russian President Vladimir Putin. "This is ridiculous."

The White House declined to comment. An official with knowledge of both calls said, "In every conversation the president has with foreign leaders, he is direct and forceful in his determination to put America and Americans first."

The official noted that Trump has since met both the Australian and Mexican leaders in person and had productive conversations with them.

The transcripts were based on records kept by White House notetakers. Such documents are commonly circulated to White House staffers and senior policymakers, but leaks of them are highly unusual.

Both calls centered on immigration-related issues with high political stakes for Trump, who built his campaign around vows to erect new barriers — physical and legal — to entry to the U.S.

But there was little discussion of the substance of those plans or their implications for U.S. relations with Australia and Mexico. Instead, Trump's overriding concern seemed to center on how any approach would reflect on him.

"This is going to kill me," he said to Turnbull. "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."

The agreement reached by the Obama administration actually called for the U.S. to admit 1,250 refugees, subject to security screening.

Trump spent much of his call with Peña Nieto seeking to enlist the Mexican president in a deal to stop talking about how the wall would be paid for.

"On the wall, you and I both have a political problem," Trump said. "My people stand up and say, 'Mexico will pay for the wall,' and your people probably say something in a similar but slightly different language."

Trump added, "I have to have Mexico pay for the wall — I have to. … I have been talking about it for a two-year period."

To solve that problem, Trump pressured Peña Nieto to stop talking about the issue. When pressed on who would pay for the wall, "We should both say, 'We will work it out.' It will work out in the formula somehow," Trump said. "As opposed to you saying, 'We will not pay,' and me saying, 'We will not pay.' "