WASHINGTON — President Trump on Sunday named a former Obama administration official who has embraced some of Mr. Trump’s hard-line positions on border security as the head of Immigration and Customs Enforcement, part of a broad effort to force federal agencies into a more aggressive crackdown on migrants.

The pick, Mark Morgan, served as the Border Patrol chief the last three months of the Obama administration, and was previously the head of internal affairs at United States Customs and Border Protection. He will lead the agency that arrests, detains and deports people who are in the United States illegally, after Mr. Trump last month withdrew his previous nominee, Ronald D. Vitiello, saying he wanted the agency to go in a “tougher direction.”

“I am pleased to inform all of those that believe in a strong, fair and sound Immigration Policy that Mark Morgan will be joining the Trump Administration as the head of our hard working men and women of ICE,” Mr. Trump said in a tweet. “Mark is a true believer and American Patriot. He will do a great job!”

Mr. Morgan, who has also been an F.B.I. agent and served in the Marine Corps, seems to have positioned himself as the type of aggressive leader Mr. Trump has desired in recent months as he has shaken up the Department of Homeland Security, pushing out a wave of top officials, including Secretary Kirstjen Nielsen. The president has grown frustrated with his own administration’s handling of immigration and other security issues, with apprehensions at the southern border soaring and some officials resisting policies they deemed impractical or illegal.