Mike Segar / Reuters President Donald Trump vowed he would veto any appropriations measure that didn’t fund his long-promised border wall. But he said he will sign a spending bill with no wall funding that Congress passed on Sept. 26.

WASHINGTON — The House on Wednesday evening passed an $853 billion spending bill that does not include money for President Donald Trump’s border wall, but he indicated he would sign it anyway.

“We’re going to keep the government open,” he said after a photo opportunity in New York City, where he is attending the United Nations General Assembly.

That decision means Trump will finish the first half of his term failing to make any progress on his campaign’s most famous promise: the construction of a wall along the southwestern border. For the year and a half of his campaign, he vowed he would build a 30-foot-tall concrete wall and would force Mexico to pay for it.

The latter promise evaporated within days of his taking office, when he told Mexico’s President Enrique Peña Nieto that he understood Mexico would not pay but asked Peña Nieto not to say that publicly to avoid embarrassing Trump.

From that point forward, Trump has been occasionally issuing angry statements on Twitter about the Republican-led Congress not giving him wall money, threatening a veto of a spending bill that fails to fund the wall and — alternatively — falsely claiming that the wall was already under construction.

But given an opportunity to make good on his veto threats, Trump has backed down and instead appears to be going along with congressional Republican leaders’ advice not to shut down the government just weeks before the midterm elections.

“It sounds like my words fell on deaf ears,” said Stephen Moore, a former Trump campaign adviser who appeared at a Tea Party rally outside the Capitol on Wednesday and led the crowd in a “Build that wall” chant.

“My point was, if Trump vetoes this bill, especially because of the wall, that’s a good fight for Republicans,” Moore said.

He added that he disagrees with congressional Republicans who believe that avoiding a shutdown would help the party in the coming elections. “Are they looking at the polls? They’re not doing so well,” he said.

A veto over the wall would excite his strongest supporters, Moore said. “From a political point of view, it’s a total winner for Trump,” he said.

Republican congressional leaders, though, arranged the temporary spending bill to make it politically difficult for Trump to veto. The section of the legislation that provides 10 weeks of funding to about one-third of the government, including the Department of Homeland Security, makes up only the final 20 pages. The first 352 pages fund the departments of Health and Human Services, Education, Labor and Defense through September 2019.

Defense alone gets $674 billion under the bill — a $20 billion increase over the current year, for which Trump has been taking credit for months. He would have to explain vetoing money for troop pay raises and new ships and planes if he vetoes the package over wall funding. That is exactly what happened in March, when Trump complained about a $1.3 trillion spending package for the entire government, in part because it did not pay for his wall, but signed it anyway because of a large increase going to the Pentagon.

Not one of Trump’s House allies who support the wall spoke against the legislation during the hour set aside for debate on the floor, and it later passed on a 361-61 vote. It passed the Senate last week 93-7 and is now headed to Trump’s desk.

He has until midnight Sunday to sign it. If he does not, much of the government will shut down with the start of the 2018–19 budget year on Oct. 1.