WASHINGTON (Reuters) - The budget deal passed by U.S lawmakers early on Friday will alleviate the spending fights that marked President Donald Trump’s first year in office, but sets the stage for a battle over immigration and who is to blame for exploding deficits ahead of November’s congressional elections.

People walk by the U.S. Capitol building in Washington, U.S., February 8, 2018. REUTERS/ Leah Millis

In the short term, reducing the risk of government shutdowns could help Trump and Republicans by conveying a greater sense of stability.

But Democrats are gearing up to use rising budget deficits under Trump and what they see as draconian immigration policies to hammer Republicans in the midterm elections when they will seek to take back control of Congress.

The two-year agreement drives the wedge even deeper between the Republican congressional establishment, which wants to govern Washington in an orderly manner, and the party’s right wing, which rails against spending bills to protest the size and reach of the federal government.

In a pre-dawn vote on Friday to approve massive new spending and end a 5-1/2-hour government shutdown, scores of conservatives in the House of Representatives revolted against their leadership in what could be a sign of Republican Party turmoil this election year.

The brief shutdown was forced by Senator Rand Paul, a Tea Party Republican, who used procedural rules to prevent passage of the budget deal before Thursday’s midnight deadline.

While conservatives, such as those in the far-right House Freedom Caucus, embraced a tax overhaul last year that will expand the nation’s debt, they adamantly oppose domestic spending increases that the budget deal allows.

“Part of our job is to make sure that we keep pounding that Republicans still stand for fiscal responsibility,” said Representative Mark Walker on Thursday. He leads a larger group of House conservatives and was among those voting against the massive spending bill on Friday.

Outside conservative groups such as the Tea Party Patriots helped power the Republican takeover of the House in 2010 in part by pushing to rein in federal spending following the 2007-2009 recession. This week, they raised the specter of challenging incumbent Republicans in primaries over the budget deal.

Tea Party Patriots Chair Jenny Beth Martin warned that if Republicans could not keep their promise to rein in federal spending, “perhaps it’s time for a new Congress.”

The budget deal’s supporters, including Trump, have backed it largely because it includes big increases in military spending.

The bill would raise military and domestic spending by about $300 billion over two years. Congress’ failure to approve it by Thursday’s midnight deadline left federal workers in the lurch early on Friday.

The White House wants to move past battles over federal spending to focus on other policy priorities such as infrastructure. A budget impasse resulted in a three-day government shutdown last month.

‘DON’T COLLUDE’

Democrats have their own problems with the measure. While they applaud more spending on veterans, the military, disaster aid and fighting opioid addiction, many are enraged it does not come with any guarantee that Congress will help “Dreamers,” people brought illegally to the United States as children.

“Don’t collude with this administration. Vote against the budget,” urged Democratic Representative Luis Gutierrez.

House Democratic leader Nancy Pelosi delivered an eight-hour speech on the House floor on Wednesday on behalf of the Dreamers and announced her opposition to the bill.

Trump has pledged to work out a deal on Dreamers, but only if the agreement includes $25 billion in funding for his promised border wall with Mexico and curbs on legal immigration.

Democrats who voted for the budget bill, however, can tout measures scattered through the legislation such as helping dairy farmers in Vermont and more subsidized child care nationwide by ending tight budget caps on domestic spending for two years.

If Congress manages to pass immigration legislation in the coming weeks, liberal anger over the budget deal will dissipate.

Democrats need a net gain of 24 seats in the House and two in the Senate to win back control of both chambers in November’s elections. If no deal on Dreamers is reached - something favored by the majority of Americans - Democrats plan to take the issue to voters.

They will also argue that the tax cuts passed by Congress in December, largely helping the rich and corporations, will cause deficits to explode and lead to Republican moves to cut social programs such as Medicare, Medicaid, and Social Security.

“They (Republicans) claim they care about fiscal responsibility, but when they pass their tax cut without any offsets they prove the opposite,” Democratic Representative Jim McGovern told Reuters.

The White House is scheduled to release its budget blueprint for the next fiscal year on Monday, and spokesman Raj Shah said the outline would be an attempt to move the country “toward a path to restoring fiscal responsibility.”