House Democrats tried but failed Friday to block spending on President Trump's proposed border wall under the annual defense bill.

Rep. Michelle Lujan Grisham, D-N.M., pressed for a House floor vote that would have added a prohibition on any Pentagon spending to build the wall. She did so at the end of debate on the National Defense Authorization Act, and her move was a protest against the House GOP decision to strip language out of that bill that would have prevented the NDAA from authorizing work on the border wall.

"The only way this body can guarantee that Trump cannot use Department of Defense funds to construct the border wall is to put that prohibition in the bill explicitly," Grisham said on the floor.

But Republicans thwarted the move, and Rep. Mac Thornberry, R-Texas, received a standing ovation for his opposition speech that said the House needs to quickly approve the fiscal 2018 defense authorization bill. The NDAA was passed by the chamber moments later, in a vote that saw most Democrats support it.

"We could spend all day and night arguing provisions that prohibit what is not in the bill. There's nothing in this bill that authorizes a border wall," Thornberry said. "The focus of the bill is the men and women who serve our nation in the military and the national security of the United States."

Thornberry, the Armed Services Committee chairman, also argued against Democrat attempts to add the controversial amendment to the $696 billion annual policy bill while it was being heard in the committee last month.

Grisham argued that Defense Secretary Jim Mattis has the authority to shift existing money to begin construction of the wall, which was a top campaign promise of Trump.