Washington, D.C. — Kevin McAleenan on Friday resigned from his post at the helm of the Department of Homeland Security, bringing an end to a six-month tenure in which he struggled to maintain control of a sprawling law enforcement and border security agency that hardliners have tried to use to push President Trump's stringent immigration agenda.

McAleenan went to the White House on Friday afternoon to tender his resignation, a source close to McAleenan told CBS News.

"His goal was to bring down the numbers of border crossings. He met that goal and he has done as much as he can in this political environment," the source said, adding that McAleenan's decision had been weeks in the making and was not fueled by the House's intensifying impeachment inquiry into the president.

Get Breaking News Delivered to Your Inbox

Mr. Trump praised McAleenan in a tweet on Friday night. "Kevin McAleenan has done an outstanding job as Acting Secretary of Homeland Security. We have worked well together with Border Crossings being way down. Kevin now, after many years in Government, wants to spend more time with his family and go to the private sector."

The president did not announce a replacement, only saying he has "wonderful" candidates for the job.

Acting U.S. Homeland Security Secretary Kevin McAleenan, center, and Panama's Security Minister Rolando Mirones, left, listen to Panama Border Police officers during a visit to a humanitarian camp in Panama, Aug. 23, 2019. Arnulfo Franco / AP

As the department's acting secretary, McAleenan, a career law enforcement official, rolled out several controversial initiatives to curb a months-long surge of Central American families heading to the U.S.-Mexico border that peaked in the spring.

In May, his first full month leading the department, the U.S. apprehended more than 133,000 migrants along the southern border — a 13-year monthly high. Since June, however, monthly apprehensions have dropped sharply, reaching about 50,000 in September.

While he spearheaded efforts that partly contributed to declines in border apprehensions, McAleenan had been overshadowed by agency officials who have been more vocal in their support for the president's immigration policies and rhetoric. McAleenan remained in his acting role despite indications that he enjoyed enough bipartisan support to be confirmed by the Senate.

In an interview with "CBS Evening News" anchor and managing editor Norah O'Donnell in July, McAleenan said he wasn't overly concerned with being formally nominated.

"I'm not worried about that right now. I'm worried about solving this problem: protecting families and kids coming to our border, protecting our border and securing it," he said. "We have a flow of opioids and synthetics that are killing Americans all across this country."

McAleenan had maintained a relatively low profile since assuming the post in April, distancing himself from the inflammatory rhetoric on immigration often employed by Mr. Trump, and focusing on leading diplomatic engagements with countries in Latin America, where most U.S.-bound migrants are coming from or transiting through.

President Donald Trump looks on as Guatemala's interior minister, Enrique Degenhart (L) and Kevin McAleenan, then U.S. Customs and Border Protection commissioner, sign an asylum or safe third country agreement in the Oval Office on July 26, 2019. Abaca/Sipa USA via AP Images

In recent weeks, McAleenan brokered "asylum cooperation agreements" with all three countries in Central America's Northern Triangle: El Salvador, Guatemala and Honduras. The deals, which have not been implemented, would allow the U.S. to reroute asylum seekers from across the world to these countries and have them seek refuge there — despite the rampant violence and poverty in many parts of this region.

McAleenan has pushed back against several controversial moves favored by hardliners in his department and the White House. He was reportedly opposed to a large-scale operation to round up migrant families with pending removal orders in cities across the U.S. In September, McAleenan also ordered U.S. Citizenship and Immigration Services to reverse its decision to scrap a program that grants protection from deportation for immigrants facing life-threatening medical conditions and other humanitarian circumstances.

He is also one of the few Trump administration officials to publicly express some regret over the implementation of the widely condemned practice of systematically separating thousands of migrant children from their parents between late 2017 and the summer of 2018.

"When you lose a public trust in law enforcement initiative— and you have to recalibrate at the presidential level—that means that wasn't successful," McAleenan told "60 Minutes" in April.

As head of Customs and Border Protection, where he served before being tapped to replace former secretary Kirstjen Nielsen in April, McAleenan oversaw the agents that carried out the separations under the "zero tolerance" policy — a practice he and other top Homeland Security officials recommended to Nielsen.

Former Homeland Security Secretary Kirstjen Nielsen, right, speaks while White House press secretary Sarah Huckabee Sanders, left, and then-Commissioner of U.S. Customs and Border Protection Kevin McAleenan, look on during a briefing at the White House, June 18, 2018. Pablo Martinez Monsivais / AP

McAleenan drew criticism from both immigration hawks and immigrant advocates and Democrats.

Earlier this week, McAleenan was forced off the stage for his scheduled keynote address at a conference in Washington after a group of pro-immigrant protesters interrupted him by chanting the names of some of the migrant children who've died in Border Patrol custody in recent months.

"When immigrants are under attack, what do we do?" one woman shouted. "Stand up. Fight back!" the rest of the protesters responded.

Under his watch, the Department of Homeland Security dramatically expanded the Migrant Protection Protocols (MPP) program, a policy that has required more than 50,000 asylum seekers to wait in northern Mexico for the duration of their legal proceedings. Opponents have been scathing in their criticism of the program, saying it violates both U.S. and international refugee law by forcing tens of thousands of migrants — including families with children — to wait in dangerous Mexican border cities where access to legal counsel is scarce.

Along with increased immigration enforcement by the Mexican government, McAleenan and the administration have directly pointed to the MPP program when explaining the drop in border apprehensions.

Late in the summer, McAleenan unveiled a regulation that would allow the U.S. to detain migrant families with children for longer periods of time than currently allowed — a move that advocates fear would lead to indefinite detention. His agency is also looking to enforce a sweeping rule allowed by the Supreme Court that will bar most non-Mexican migrants from seeking asylum at the U.S.-Mexico border.

In a series of tweets Friday night, the president said he would announce McAleenan's replacement next week.

Democratic Representative Bennie Thompson of Mississippi, who chairs the House committee with oversight over the Department of Homeland Security, said McAleenan's successor should be formally nominated for a Senate confirmation process. The candidates, Thompson added, should not have blind loyalty to the president.

"The next Secretary must also understand that bowing to President Trump's obsession over a wall and keeping people out is not part of the job description," Thompson said in statement.