WASHINGTON — The House approved on Thursday a bundle of spending bills, including $1.57 billion that President Trump requested to build a wall along the Mexican border, which could serve as the opening salvo in a new congressional battle to keep the government funded.

The nearly $790 billion package, which passed 235 to 192, would fund a slew of security-related government expenses and gave House Republicans a fresh victory on the cusp of a more than five-week recess. Five Republicans voted against the measure, and five Democrats voted for it.

But the legislation is almost certain to fail in the Senate, where picking up the tab for Mr. Trump’s signature campaign promise — a border wall, which he has vowed Mexico ultimately will fund — is a deal-breaker for Democrats.

“Not only is his border wall expensive and unnecessary, members of this body who care deeply about our national defense shouldn’t be forced to decide to vote for this ridiculous proposal,” said Representative Ruben Gallego, Democrat of Arizona, who served in the Marine Corps.