The U.S. House of Representatives approved a $740 billion defense bill that U.S. President Donald Trump has threatened to veto - setting the stage for a possible confrontation, The Associated Press reported Wednesday.

The 335-78 vote Tuesday backing the National Defense Authorization Act came after Trump renewed his opposition unless legislators clamped down on social media platforms he claimed were not fair to him.

The bill funds the Department of Defense and Energy Department's national security programs for 2021 - including a 3% pay increase for U.S. troops. It includes items related to antimony-laundering programs, overseas military commitments, cybersecurity, Space Force and the U.S. border wall.

It defies the incumbent president's plans to retain the titles of military bases named after Confederate figures and pull out soldiers from Germany and Afghanistan.

If the bill doesn't pass it will highlight the end of a streak of nearly six decades of success for the U.S. defense allocation and throw into disorder hundreds of proposed defense changes and other plans.

Trump said he would rule against the "very weak National Defense Authorization Act'' unless it revokes a section that protects Facebook, Twitter and other tech companies from content accountability.

"Our service members and national security are more important than politics," Democratic congressman Adam Smith, who chairs the House Armed Services panel, said in a statement.

The Senate is set to vote on the bill this week. Advocates hope Trump will reconsider his rejection threat if the legislation passes by a margin identical to the one in the House.

For the legislation to become law, Trump must sign it - or it can be enacted into law without his signature after 10 days. If he rejects it, funding for selected defense programs will expire Jan. 1.