President Trump compared his record to that of former President Barack Obama while defending his new deal with Mexico to reduce illegal immigration, and in Trump’s opinion, it’s no contest.

“If President Obama made the deals that I have made, both at the Border and for the Economy, the Corrupt Media would be hailing them as Incredible, & a National Holiday would be immediately declared,” Trump tweeted Sunday. “With me, despite our record setting Economy and all that I have done, no credit!”

The comment came after Trump lashed out at the New York Times in a series of tweets for casting doubt on the breakthrough he claimed for his deal with Mexico to avoid tariffs and “stem the tide” of migrants on their way to the U.S. southern border. The Times disputed the credit he said he deserved, reporting that aspects of the agreement had already been agreed upon months before the president’s tariff threat.

The deal, the “U.S.-Mexico Joint Declaration,” which was released by the State Department after Trump’s announcement, outlined measures that would be taken by Mexico to reduce the surge of immigrants, mostly from Central America, passing through Mexico on their way to seek asylum in the U.S., including the “deployment of its National Guard throughout Mexico, giving priority to its southern border.”

“But the Mexican government had already pledged to do that in March during secret talks in Miami between Kirstjen Nielsen, then the secretary of homeland security, and Olga Sanchez, the Mexican secretary of the interior,” Times correspondents Michael D. Shear and Maggie Haberman wrote, pointing out that Mexico had already agreed to several other aspects of the deal months before Trump’s tariff threat.

Former President Barack Obama and President Donald Trump (Photos: Stephane Cardinale/Corbis/Getty Images; Sarah Silbiger/ Getty Images)

On Sunday, Trump defended his deal, saying, “We have been trying to get some of these Border Actions for a long time, as have other administrations, but were not able to get them, or get them in full, until our signed agreement with Mexico.”

Story continues

“For many years,” he continued, “Mexico was not being cooperative on the Border in things we had, or didn’t have, and now I have full confidence, especially after speaking to their President yesterday, that they will be very cooperative and want to get the job properly done.”

President Obama faced what he described as “an actual humanitarian crisis” at the border when a surge of unaccompanied Central American children arrived in 2014, and his administration placed them in temporary camps on military bases until the number of shelters contracted by the Department of Health and Human Services was expanded to properly house them.

Earlier, Obama and then Mexican President Felipe Calderon held talks to join forces against drug violence in Mexico, which was linked to illegal border crossings into the U.S. Around this time, in 2010, Obama signed a bill appropriating $600 million to boost border security.

But in recent months, alarming numbers of arrivals at the border have included unaccompanied children and families largely from Central America’s Northern Triangle (Honduras, Guatemala and El Salvador) where violence and poverty have increased over the past few years.

“Immigration officers have made 266,000 arrests of criminal aliens in the last two fiscal years,” the White House said in a February statement, when Trump declared a national emergency at the southern border in order to unilaterally shift funds from other departments to build his long-promised wall.

As illegal immigration overwhelmed border officials and facilities, Trump responded with a threat of tariffs on Mexico that were scheduled to go into effect Monday, but he “indefinitely suspended” them in light of the newly announced U.S.-Mexico deal.

“There is now going to be great cooperation between Mexico & the USA, something that didn’t exist for decades,” Trump tweeted Sunday. “However, if for some unknown reason there is not, we can always go back to our previous, very profitable, position of Tariffs - But I don’t believe that will be necessary.”

He noted that one provision of the deal was being kept secret and would be disclosed “at the appropriate time.”

_____

Read more from Yahoo News: