In this May 2, 2017, photo, House Speaker Paul Ryan of Wis., accompanied by Rep. Cathy McMorris Rodgers, R-Wash., speaks to reporters on Capitol Hill in Washington. A government-wide spending bill that President Donald Trump seemed to criticize Tuesday morning but now calls “a clear win for the American people” is headed for a House vote on Wednesday.

WASHINGTON (AP) — The House easily passed a $1.1 trillion governmentwide spending bill on Wednesday, awarding wins to both Democrats and Republicans while putting off until later this year fights over President Donald Trump’s promised border wall with Mexico and massive military buildup.

The 309-118 vote sends the bill to the Senate in time for them to act to avert a government shutdown at midnight Friday. The White House has said Trump would sign the measure, which is the first major legislation to pass in Trump’s short, turbulent presidency.

House Speaker Paul Ryan praised the measure as bipartisan, and said the biggest gain for conservatives came as Democrats dropped longstanding demands to match Pentagon increases with equal hikes for nondefense programs.

“No longer will the needs of our military be held hostage by the demands for more domestic spending,” Ryan said. “In my mind, that is what’s most important here.”

Democrats also backed the measure, which protects popular domestic programs such as education, medical research and grants to state and local governments from cuts sought by Trump — while dropping a host of GOP agenda items found in earlier versions.

“It’s imperative to note what this bill does not contain,” said Rep. Nita Lowey of New York, lead negotiator for Democrats. “Not one cent for President Trump’s border wall and no poison pill riders that would have prevented so-called sanctuary cities from receiving federal grants, defunded Planned Parenthood, undermined the Affordable Care Act.”

The bill is the product of weeks of Capitol Hill negotiations in which top Democrats like House Minority Leader Nancy Pelosi successfully blocked Trump’s most provocative proposals — especially the Mexico wall and cuts to popular domestic programs like community development grants.

The White House won $15 billion in emergency funding to jumpstart Trump’s promise to rebuild the military and an extra $1.5 billion for border security — each short of Trump demands — leading the president on Tuesday to boast, “this is what winning looks like.”

The opinions of top party leaders were not shared by everyone in the rank and file, some of whom feel that GOP negotiators too easily gave up on conservative priorities, such as cutting funds for Planned Parenthood and punishing “sanctuary” cities that fail to cooperate with immigration authorities.

“I don’t think it was negotiated very well, and I’ll just leave it at that,” said Rep. Jeff Duncan, R-S.C.

The long-overdue bill buys just five months of funding while Trump and his allies battle with congressional Democrats over spending cuts and funding for the wall, which Trump repeatedly promised during the campaign would be financed by Mexico. Mexican officials have rejected that notion.

Republicans were surprised by tweets from Trump on Tuesday that suggested he was initially unhappy with the measure and might provoke a government shutdown this fall in hopes of getting his way on the wall and other demands.

The measure is the product of a bipartisan culture among Congress’ appropriators, with money for foreign aid, grants to state and local governments and protection for the Environmental Protection Agency from cuts sought by tea party Republicans. The measure provides $2 billion in disaster aid money, $407 million to combat Western wildfires, additional grants for transit projects and a $2 billion increase for medical research at the National Institutes of Health.

The White House, Senate Majority Leader Mitch McConnell, R-Ky., and Sen. Joe Manchin, D-W.Va., won a $1.3 billion provision to preserve health benefits for more than 22,000 retired coal miners. Pelosi was the driving force behind an effort to give the cash-strapped government of Puerto Rico $295 million to ease its Medicaid burden.

More in Politics

President Donald Trump’s national security adviser said Saturday there was “incontrovertible” evidence of a Russian plot to disrupt the 2016 U.S. election, a blunt statement that shows how significantly the new criminal charges leveled by an American investigator have upended the political debate over his inquiry.

The University of Colorado leadership is grappling with how to address a nationwide nosedive in the favorability of higher education — particularly, among conservatives — as CU’s own representatives and decision-makers disagree on what’s behind the downturn.