Mark Morgan, the Border Patrol chief who backed former President Barack Obama's plans to safeguard some illegal immigrants from deportation, is out at the agency on the heels of President Donald Trump's announcement of an ambitious plan to build a massive wall at the Mexican border and hire 5,000 Border Patrol agents.

Morgan told employees on a phone call Thursday morning that he was not resigning but had been asked to leave by the Trump administration, Reuters reported, citing a Department of Homeland Security official who spoke on the condition of anonymity.

The border patrol union, which endorsed Trump's presidential campaign and applauded his executive order, had been critical of Morgan.

Customs and Border Protection said Thursday that Morgan's last official day in office will be Tuesday.

A U.S. official and a former official told The Associated Press that Border Patrol agents were told Thursday that Morgan was no longer with the agency.

The U.S. official wasn't authorized to discuss the move before a public announcement and spoke to The Associated Press on condition of anonymity. The former official asked not to be identified before a government announcement.

Morgan was named to the post in June and took office in October. The former FBI agent briefly led the internal affairs department at the Border Patrol's parent agency before heading the agency of roughly 20,000 agents.

Morgan leaves office only seven months after being named the first outsider to lead the agency since it was founded in 1924.

From the start, he clashed with the Border Patrol's union, which endorsed Trump early and forcefully during the presidential campaign. The National Border Patrol Council had advocated for an insider to lead the agency and sharply criticized Morgan at almost every turn.

The former official said Morgan was not at work yesterday and did not attend a gathering at the Homeland Security Department with Trump and newly appointed Homeland Security Secretary John Kelly.

During that visit Trump singled out the union's president, Brandon Judd, while pointedly avoiding mention of Morgan. Judd served on Trump's transition team.

The union was incensed when Morgan told a Senate hearing Dec. 1, in response to a question from Sen. Tom Carper, D-Del., that he supported a comprehensive immigration overhaul, which is often interpreted to include a path to citizenship for people who are in the country illegally. Morgan clarified his remarks in a note to Border Patrol staff the following week.

"I want to be clear what my position is regarding immigration reform," Morgan wrote. "I do not, as some have suggested, support what is often referred to as 'blanket amnesty.' This assertion could not be further from my position. I encourage everyone to listen to my testimony."

Despite pressure from the union, many agency officials said Morgan appeared to embrace the job. Less than a week ago, the first message on his new Twitter account read, "Chief Morgan here -- excited to use this account to share the latest news and events of the #BorderPatrol with followers."

The Associated Press and Reuters contributed to this report.