WASHINGTON -- The Border Patrol chief is leaving the agency on the heels of President Trump’s announcement of an ambitious plan to build a massive wall at the Mexican border and hire 5,000 Border Patrol agents.

Border Patrol Chief Mark Morgan was asked to resign earlier this week by the acting commissioner of Customs and Border Protection, which oversees the agency, CBS News has learned.

Morgan’s departure was part of an effort by the incoming administration at the Department of Homeland Security and Customs and Border Protection to show the agency will be headed in a new direction, a source told CBS News.

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

Get Breaking News Delivered to Your Inbox

“I wish him every success in the future,” Acting Commissioner Kevin McAleenan said in a statement.

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 Mr. 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.

A former official told The Associated Press Morgan was not at work Wednesday and did not attend a gathering at the Homeland Security Department with Mr. Trump and newly appointed Homeland Security Secretary John Kelly.

During that visit Mr. Trump singled out the union’s president, Brandon Judd, while pointedly avoiding mention of Morgan. Judd served on Mr. 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.”