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 okay.” 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.”

He described the wall as “the least important thing we are talking about, but politically this might be the most important.”

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

advertisement | advertise on newsday

Produced by White House staff, the documents provide an unfiltered glimpse of Trump’s approach to the diplomatic aspect of his job, subjecting even a close neighbor and long-standing ally to streams of threats and invective as if aimed at U.S. adversaries.

The Jan. 28 call with Turnbull became particularly acrimonious. “I have had it,” Trump erupted after the two argued about an agreement on refugees. “I have been making these calls all day, and this is the most unpleasant call all day.”

Before ending the call, Trump noted that at least one of his conversations that day had gone far more smoothly. “Putin was a pleasant call,” Trump said, referring to Russian President Vladimir Putin. “This is ridiculous.”

The White House declined to comment. An official familiar with both conversations, who refused to speak on the record because the president’s calls have not been declassified, said, “The president is a tough negotiator who is always looking to make the best possible deals for the American people. The United States has many vital interests at stake with Mexico, including stopping the flow of illegal immigration, ending drug cartels’ reach into our communities, increasing border security, renegotiating NAFTA and reducing a massive trade deficit. 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 who monitored Trump’s calls. Known as a “memorandum of conversation,” such documents are commonly circulated to White House staff and senior policymakers.

Both documents obtained by The Post contain notes indicating they were reviewed and classified by retired Lt. Gen. Keith Kellogg Jr., who serves as chief of staff on the National Security Council.

Portions of Trump’s strained conversations with Turnbull and Peña Nieto were reported earlier this year. But the transcripts trace the entire course of those calls from greeting to confrontation to — in the case of Turnbull — abrupt conclusion.

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 United States.

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.

advertisement | advertise on newsday

“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 United States 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. Two days earlier, Trump had signed an executive order mandating construction of the wall, but funding for it remains unclear.

“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 seemed to acknowledge that his threats to make Mexico pay had left him cornered politically. “I have to have Mexico pay for the wall — I have to,” he said. “I have been talking about it for a two-year period.”

advertisement | advertise on newsday

To solve that problem, Trump pressured Peña Nieto to suppress 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.’ ”