WASHINGTON (AP) - Kevin McAleenan, the acting Homeland Security secretary, is challenging a subpoena to appear before a congressional committee to discuss terrorism threats to the U.S. on the day before he's set to leave office.

Kevin McAleenan sent a letter to House Homeland Security Chairman Bennie Thompson on Friday saying he was surprised and disappointed to get the subpoena a day earlier. McAleenan had suggested that the department's top intelligence officer testify in his stead.

Thompson, a Democrat from Mississippi, is holding a hearing on Oct. 30 on terrorist threats facing the country. McAleenan is set to leave his job on Oct. 31 after six months in the position. He took over after Secretary Kirstjen Nielsen quit.

"It was surprising to receive your subpoena because your staff and mine were in the middle of constructive and ongoing discussion regarding the committee's hearing," McAleenan wrote.

He said he intended to "exhaustively prepare" for the hearing but instead is focused on winding down his tenure and "facilitating an orderly departure."

But it's still unclear who is taking over.

No replacement has been named to the department, which has seen its top ranks decimated through firings and resignations. The acting DHS deputy secretary is the head of the Transportation Security Administration.

The House committee subpoenaed McAleenan along with Russell Travers, the acting director of the National Counterterrorism Center.

If McAleenan defies the subpoena, he could be held in contempt following a vote that could be referred to the Justice Department for possible prosecution - which would be highly unlikely.

Thompson said in a statement Thursday that he was concerned that turmoil within the White House and "vacancies at the highest levels of the Department of Homeland Security are undermining our ability to respond to terrorist threats."

"It is inexcusable that the people charged with keeping the country safe from terrorism are refusing to show up to testify before Congress and speak to the American people about what they are doing to secure the homeland," he said.

None of the other witnesses on the panel was a member of the Cabinet. He or she would not have the same access to the president and would not necessarily be subjected to the same types of questions.

Democrats are proceeding with an impeachment inquiry into President Donald Trump, though this hearing was unrelated.

The 240,000-person Department of Homeland Security is tasked with election security and cybersecurity, disaster response and even the Secret Service. But in Trump's world, homeland security means one thing: immigration.

The president's signature issue makes the department his focus and his ire. Balancing a White House eager to push major changes with the reality on the ground is a constant challenge.

McAleenan, who has years of experience with border issues and is a longtime civil servant, was seen in Trump's circle as someone who could get control over the crisis, despite his stance as a moderate Democrat who pushed for aid to be restored to Central American nations.

He was among those behind the administration's widely maligned practice of separating families at the border last year, though McAleenan later said he regretted the policy because it lost the public trust.

He also expanded a program where asylum seekers are forced to wait their claims out in Mexico; more than 42,000 migrants have been subjected to it. And most recently, the administration made migrants ineligible for asylum if they crossed through a third country on their way to the U.S.

He also brokered major agreements with Central American countries on asylum and border security - something others were unable to do.

McAleenan suggested that the way the subpoena was issued may have violated committee rules - he said he was given no notice and neither was the ranking member.

Thompson said in a statement on Friday that McAleenan's facts were wrong.

"To be clear, no rules were broken by the Committee and his appearance remains legally required. It seems he just doesn't want to testify," Thompson said. "The American people have a right to know if anyone is in charge at DHS and what is being done to keep the country safe."

tag