WASHINGTON -- The Democratic-led House failed Tuesday to override President Donald Trump's first veto, salvaging his effort to steer billions of extra dollars to erecting border barriers and delivering a victory to the White House in a constitutional and political clash that's raged for months.

Lawmakers voted 248-181 to overturn Trump's veto, but that fell 38 votes shy of the required two-thirds margin. Just days after Attorney General William Barr announced that special counsel Robert Mueller had found Trump didn't scheme with Russia to help his 2016 election, Tuesday's vote bolstered Trump's drive to build a wall along the boundary with Mexico, a hallmark of his 2016 presidential campaign and a priority of his presidency.

"Thank you to the House Republicans for sticking together and the BIG WIN today on the Border," Trump tweeted. "Today's vote simply reaffirms Congressional Democrats are the party of Open Borders, Drugs and Crime!"

While clearly a defeat for Democrats, the vote afforded them a chance to reemphasize policy differences with Trump and change the subject from collusion allegations that have lost political clout. Underscoring that, House Speaker Nancy Pelosi placed her name atop a House Democratic fundraising email referencing the failed veto override, writing, "I know grassroots Democrats won't let Trump's enablers get away with this."

Just 14 Republicans joined all voting Democrats in Tuesday's futile effort to void Trump's declaration of a national emergency at the Southwest border.

By invoking that power, Trump has said he will shift $3.6 billion from military construction to erecting barriers along that boundary. Congress has voted to provide less than $1.4 billion for border barriers, leaving Democrats and some Republicans fuming that Trump is abusing his powers by ignoring Congress' constitutional control over spending.

Despite his veto remaining intact, Trump may not be able to spend the money for barriers quickly because of lawsuits by Democratic state attorneys general and others that could take years to resolve.

Trump insisted during his campaign that Mexico, not taxpayers, would pay for the wall. To keep the issue alive into the 2020 campaign season, House Democrats may force fresh votes on the emergency declaration in six months, as the law allows.

The Pentagon sent lawmakers a list last week of hundreds of military construction projects that might be cut to pay for barrier work. Though the list was tentative, Democrats say that by backing Trump, GOP lawmakers were endangering local bases to pay for the wall.

Unhappiness over Trump's plan to siphon the money from the military has become a bipartisan concern. On top of the $3.6 billion from construction, the Pentagon has informed Congress that it wants to steer another $1 billion from personnel accounts to border barriers.

At a House Armed Services Committee hearing Tuesday, panel Chairman Adam Smith, D-Wash., said it was wrong to use the Pentagon as "sort of a piggybank-slash-slush fund." The committee's top Republican, Mac Thornberry of Texas, also said he opposes redirecting defence funds.

Acting Defence Secretary Patrick Shanahan told the lawmakers that while his department could pay a future price for manoeuvring around Congress, he was following a "legal order from the commander in chief."

Congress had approved a resolution annulling the national emergency that Trump declared at the U.S.-Mexico border in February. That included passage by the Republican-led Senate, in which 12 GOP senators -- nearly 1 of every 4 -- joined Democrats in blocking him.

Trump vetoed that measure almost immediately.

"We take an oath that we must honour" to protect the Constitution," Pelosi, D-Calif., speaking on her 79th birthday, said Tuesday. "The choice is simple, between partisanship and patriotism. Between honouring our sacred oath or hypocritically, inconsistently breaking this oath."

Rep. Joaquin Castro, D-Texas, called Trump's declaration "constitutional vandalism."

Republicans said Trump was merely following a 1976 law that gives presidents emergency powers, and was trying to head off Democrats with little concern about border security.

Rep. Tom McClintock, R-Calif., said Trump was acting against the "radical left in this House that would dissolve our borders entirely if given the chance" -- a stance that no Democrat has taken. Rep. Paul Mitchell, R-Mich., called the veto override effort "a partisan whack job" because of its certain defeat.

All 13 Republicans who voted with Democrats last month to oppose Trump's declaration did the same Tuesday. They were joined by Rep. John Katko, R-N.Y., who missed the earlier roll call.

Border arrests are up since falling to a 46-year-low during Trump's first year in office.

John P. Sanders, Customs and Border Protection's chief operating officer, said Tuesday that the agency expected to make 100,000 arrests or denials of entry in March, about double the 50,347 during the same period last year. Nearly 6 in 10 are arriving as families.

U.S. authorities made 4,036 border arrests Monday, the highest mark ever, Sanders told reporters in San Antonio, Texas.

The showdown began building last year. Trump's insistence on wall money prompted this winter's record 35-day partial government shutdown, which ended when he surrendered in January without getting any funds. Eventually a $1.4 billion compromise was struck.

Opponents of Trump's emergency warned that besides usurping Congress' power over spending, he was inviting future Democratic presidents to circumvent lawmakers by declaring emergencies for their own favoured initiatives.

------

National Security Writer Robert Burns and reporter Lolita C. Baldor in Washington and Nomaan Merchant in San Antonio contributed.