President Trump told then-Customs and Border Protection Commissioner Kevin McAleenan during a trip to the southern border last Friday that he would pardon the government official if he was convicted of violating immigration laws as a result of enforcing the White House's agenda, according to a report published Friday evening.

Trump made the promise to McAleenan during their trip to Calexico, Calif., on April 5 in the same conversation in which he told Customs and Border Protection to block Central American asylum-seekers from entering the country.

Trump said he "would pardon him if he ever went to jail for denying U.S. entry to migrants," senior administration officials told CNN.

Two days after that conversation, Trump and then-Homeland Security Secretary Kirstjen Nielsen parted ways, and he announced McAleenan would be taking over the 240,000-person department as acting secretary.

It's not clear if the comment was meant seriously and Customs and Border Protection did not immediately respond to a request for comment.

A homeland security spokesman told CNN, "At no time has the President indicated, asked, directed or pressured the Acting Secretary to do anything illegal. Nor would the Acting Secretary take actions that are not in accordance with our responsibility to enforce the law."