WASHINGTON (Reuters) - The U.S. Senate on Thursday gave final legislative approval to a $1.2 trillion spending bill to keep the government open through September, a measure President Donald Trump is expected to sign before Friday’s deadline.

FILE PHOTO: The dome of the U.S. Capitol is seen in Washington September 25, 2012. REUTERS/Kevin Lamarque/File photo

Senators from both Republican and Democratic parties voted in favor of the bill, which passed 79 to 18 with only Republicans opposing the measure, citing minimal changes to spending levels.

The bill, which was passed 309-118 in the Republican-controlled U.S. House of Representatives on Wednesday, now heads to Trump. While it failed to include many of the items Trump had requested, he is expected to sign the bill before midnight Friday, when without his signature the government would shut down.

As soon as this spending measure is law, lawmakers and Trump must already begin looking forward to the next deadline on Oct. 1. Lawmakers are hopeful they can pass regular spending bills but the process is likely to be complicated by Republican efforts to repeal Obamacare, a desire to rewrite the tax code and a need to find a deal to raise the debt ceiling since the limit is expected to be reached in the fall.

Under the compromise measure, the Pentagon’s funding increased, a priority that had been laid out by Republicans and Trump. It also funded Democratic priorities, including health care subsidies.

“This bill is far from perfect, but it’s better than how we are spending our money today, better than how we were spending our money a year ago,” Republican Senator Roy Blunt said on the Senate floor.

Democrats also claimed victory in the passage of the legislation, arguing that it fails to fund Trump’s priorities including money to build a wall along the U.S.-Mexico border. Additionally, the bill funds subsidies for health care coverage provided through the Affordable Care Act, former Democratic President Barack Obama’s signature domestic legislation.

Republican Senator Ted Cruz gave his reasons for voting against the bill.

“While I am pleased to see increased funding for our men and women in uniform and their critical missions across the globe, this bill fails in a number of ways, including by continuing to fund sanctuary cities, Planned Parenthood, and Obamacare,” Cruz said.

Sanctuary cities are those that give limited cooperation to the federal government in enforcing immigration laws and Planned Parenthood is a conservative target because abortion is among the women’s health care services it provides.

The spending bill does not include many of the spending cuts on domestic programs Trump had sought and adds $2 billion for the National Institutes of Health, $295 million for Puerto Rico’s underfunded Medicaid healthcare for the poor and $407 million for firefighting in Western states.

The legislation adds $12.5 billion in defense spending. It makes $2.5 billion more available after Trump gives details on his plans for fighting the Islamic State militant group.

The bill was approved months after the Oct. 1 2016 deadline to pass government funding for the fiscal year. For the past seven months, federal agencies have been operating mainly on simple extensions of the previous year’s funding and the priorities that came with that.