(CNN) Secretary of Defense Mark Esper faced a bipartisan grilling from lawmakers Wednesday on Capitol Hill for his decision to divert military funding to pay for the US border wall as he testifies before the House Armed Services Committee.

The move to shift $3.8 billion to the border "undercuts any argument about the need for resources within the Department of Defense and it also undercuts the congressional process," the chairman of the House Armed Services Committee, Democratic Rep. Adam Smith, told Esper during the hearing.

"This effort to keep stealing money for the wall is really undermining the Department of Defense, and is something, regardless of how you feel about the wall, we should have a bipartisan consensus that should not be done," Smith added.

The top Republican on the committee, Rep. Mac Thornberry, also slammed the move saying it is "substituting the judgement of the administration for the judgement of Congress," adding "I am deeply concerned about where we're headed with the constitutional issue."

In a letter dated Tuesday, Smith and Thornberry wrote to the Pentagon's top budget official slamming the decision to repurpose military funds for the border wall via a process known as "reprogramming."

Read More