Washington (CNN) President Donald Trump decided to shift military funds to build the southern border wall last month despite warnings from top Pentagon officials who cautioned that doing so could hurt the Defense Department long-term, Acting Defense Secretary Patrick Shanahan said Tuesday.

Shanahan told lawmakers on the House Armed Services Committee that the President opted to move forward with the plan after being informed it would likely cause the Pentagon to lose "what amounts to a privilege," when it comes to its ability to re-program certain funding without formally seeking congressional approval to do so.

Prior to the emergency declaration, "we said here are the risks to the department long term and those risks were weighed," Shanahan said, adding that the Pentagon is executing a "legal order from the commander in chief."

The Pentagon notified Congress Monday night that it authorized the transfer of $1 billion to begin new wall construction along the US-Mexico border, drawing immediate objections from Democratic lawmakers.

A Pentagon budget reprogramming notification sent to Capitol Hill on Monday and obtained by CNN indicates that up to $1 billion will go toward building 57 miles of fencing, improving roads and other measures on the southern border.

Read More