The Democratic-controlled House voted 322 to 87 to override Trump’s veto of the $740.5 billion bill, with 109 members of the president’s own party siding with Democrats.
A similar motion will be introduced in the Republican-majority Senate, where it will also have to gain two-thirds support to override the president’s veto.
The National defence Authorization Act, which includes funding for military projects and a pay rise for troops, was passed this month by 335 votes to 78 in the House and by 84 to 13 in the Senate.
But the NDAA was vetoed by the president because it did not repeal Section 230, a federal law that provides liability protection to internet companies.
Trump also opposed a provision that would strip several US military bases of the names of generals who fought for the secessionist, pro-slavery South in the 1861-65 Civil War.
Including the defence bill, Trump has vetoed nine bills during his four years in the White House. Congress has not previously mustered the votes needed to override any of his vetoes.