The House on Wednesday approved a $1.1 trillion spending bill, with Democrats and Republicans both jockeying to claim at least partial victory as the measure goes to the Senate for final approval.

The package, which would avert a government shutdown at the end of the week, passed with bipartisan support, 309-118.

House Minority Leader Nancy Pelosi claimed victory for blocking several of President Trump's proposals -- including funding for a U.S.-Mexico wall and cuts to popular domestic programs like community development grants.

SEE WHAT'S IN SPENDING BILL

However, House Speaker Paul Ryan, R-Wis., assured conservatives that the bill is a win for Trump and Republicans controlling Congress, citing "a really good down payment" on rebuilding the military and "the biggest increase in border security in a decade."

Minutes before the vote on the five-month spending bill, White House Press Secretary Sean Spicer made similar arguments.

“When you look at what the president came forward with a month ago, saying these are my priorities, I think he got what he asked for,” Spicer said during the daily briefing.

He also said the money “gets the president’s priorities jumpstarted” and argued that Trump can build on that success in the upcoming full-year budget.

Spicer touted increased military spending and money to extend a Washington, D.C., school voucher program through 2019 being included in the bill.

The White House has said Trump would sign the measure.

Democrats are touting as victories parts of the bill that protect popular domestic programs such as education, medical research, and grants to state and local governments that Trump wanted to cut.

"Every member of this House has a victory in the bill," said Rep. Tom Cole, R-Okla.

The White House won $15 billion in emergency funding toward Trump's promise to rebuild the military and an extra $1.5 billion for border security, which led 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 of conservative priorities such as cutting funds for Planned Parenthood and punishing "sanctuary" cities that fail to cooperate with immigration authorities.

"From my point of view, we pretty well got our clock cleaned," said Sen. Lindsey Graham, R-S.C.

One of Trump’s biggest campaign promises was to build the wall and have Mexico pay, a plan Mexican officials have rejected.

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

The measure also includes money for foreign aid, grants to state and local governments and protects the Environmental Protection Agency from cuts sought by Tea Party-backed 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.

The Associated Press contributed to this report.