WASHINGTON (NEXSTAR) — The House voted 320 to 99 to pass a temporary extension of government funding on Thursday, avoiding a partial government shutdown before the Friday night deadline.

“It’s been a long road to get here,” House Speaker Mike Johnson (R-La.) said.

Speaker Johnson says the bill gives lawmakers more time to pass a year-long budget.

“The appropriations process is ugly. Democracy is ugly,” Johnson said. “This is the way it works every year, always has.”

The deal extends funding for some government agencies until March 8, and the rest until March 22.

However, not all Republicans were on board. Rep. Thomas Massie (R-Ky.) says he voted against the bill because he believes a short-term measure isn’t a solution.

“We’re going to kick the can down the road,” Massie said. “Is that going to solve any problems? No, it creates another crisis next week.”

Rep. Matt Gaetz (R-Fla.) says Congress needs to take action to cut the deficit.

“We ought to pass single subject spending bills and we ought to vote for the spending cuts that this country so desperately needs,” Gaetz said.

Speaker Johnson defended the bill to his party’s critics. He says he held the line against Democrats calls for more spending.

“This is a bipartisan agreement in the end, but it sticks to the numbers, the agreement on spending, it does not go above that,” Johnson said.

Rep. Chuck Fleischmann (R-Tenn.) agrees and says he believes lawmakers will work quickly to pass the 12 appropriations bills.

“The American people want us to do our work,” Fleischmann said. “To do our work well, we’ve got to keep the government open.”

Democrats say they hope the division in the Republican party doesn’t derail the new spending deadline later this month.

“House Democrats will stand in lockstep to ensure that that doesn’t happen,” Rep. Pete Aguilar (D-Calif.) said.

Senate Majority Leader Chuck Schumer says he hopes his chamber can pass the legislation late Thursday.