Speaker Mike Johnson’s proposal to avert a government shutdown at the end of the week ran into increasing opposition on Monday from hard-line Republicans. But with Democratic opposition softening, it appeared the plan could be headed toward bipartisan approval within days.

The shifting alliances came as the House planned to take its first action on the bill as early as Tuesday. The legislation would fund federal agencies into early 2024 with two staggered deadlines, allowing lawmakers time to try to finish off the annual spending bills and putting off a debate over wartime aid to Israel and Ukraine.

It was reminiscent of the situation in the House about six weeks ago. Kevin McCarthy, the speaker at the time, was facing right-wing opposition to a measure to keep federal funding flowing and was forced to turn to Democrats to push through a temporary extension. The move cost Mr. McCarthy his speakership.

But Mr. Johnson — who is far more conservative than Mr. McCarthy — was not expected to face similar blowback from Republicans, who are not eager to repeat the dysfunction and paralysis that followed their last speaker’s ouster.

Funding for federal agencies is now set to expire at midnight Friday if Congress does not extend the deadline again. In searching for a solution, Mr. Johnson, the Louisianian who was installed as speaker a few weeks ago, has confronted the same dynamic that Mr. McCarthy did: Hard-line conservatives would not support a spending extension without deep cuts or conservative policy provisions added. But such a measure could not make it through the Democratic-controlled Senate, forcing him to turn to Democrats for help.

Leaders of the far-right bloc of House Republicans criticized the proposal because it would temporarily maintain spending at levels set at the end of last year — when Democrats controlled the House, the Senate and the White House — without new conditions.

“I will not support a status quo that fails to acknowledge fiscal irresponsibility, and changes absolutely nothing while emboldening a do-nothing Senate and a fiscally illiterate president,” Representative Scott Perry, Republican of Pennsylvania and the leader of the hard-line Freedom Caucus, wrote on the social media site X.

Another member of the Freedom Caucus, Representative Andrew Clyde of Georgia, wrote, “We simply cannot continue funding Joe Biden, Chuck Schumer, and Nancy Pelosi’s radical policies and bloated spending levels.”

The opposition from within his own party left Mr. Johnson looking for votes from Democrats for his proposal. It would fund one set of federal programs — including veterans’ and military construction programs, agriculture, transportation, housing, and energy and water development — through Jan. 19. The Pentagon and all other federal programs would be funded through Feb. 2.

Top Democrats were not happy with the convoluted approach but saw the plan, known as a continuing resolution or C.R., as potentially the surest way to avoid a shutdown in the short time remaining before the deadline.

“I am pleased that Speaker Johnson seems to be moving in our direction by advancing a C.R. that does not include the highly partisan cuts that Democrats have warned against,” Senator Chuck Schumer, Democrat of New York and the majority leader, said as the Senate convened on Monday.

In another encouraging sign for the legislation, Mr. Schumer put off a planned vote on an alternate funding mechanism the Senate was set to take up, saying that he would “allow the House to move first with their proposal.”

Representative Hakeem Jeffries of New York, the minority leader, said in a letter to fellow House Democrats that the leadership was “carefully evaluating the proposal” and remained “concerned with the bifurcation of the continuing resolution in January and February 2024.” The proposal did not contain the sort of hard-right policy provisions that would have made the plan a nonstarter with House Democrats, though Mr. Jeffries noted that it failed to make any progress on aid to Ukraine and Israel.

The White House has been critical of the Johnson proposal, but President Biden declined on Monday to weigh in on whether he would veto the plan if it reached his desk.

“Let’s wait and see what they come up with,” Mr. Biden told reporters at the White House.

Mr. Johnson may need Democratic help beyond winning approval of the bill. Republicans could balk at the procedural steps needed to put the bill on the floor. That would require Democrats to bail out the speaker on that vote as well, even though the minority party is typically reluctant to produce the votes on procedural matters for the majority.

Given Republican resistance to the legislation and Democratic queasiness about helping with the procedural effort, the Republican leadership took steps late Monday to bring the spending bill to the floor under a maneuver that skirts the need for the initial procedural vote. Instead, the bill would be brought up under a shortcut known as a suspension of the rules, but it would require a two-thirds majority, or 290 votes, to pass. The last stopgap bill averting a shutdown was passed under the same process on Sept. 30.

The move by Republican leaders showed that they expected a substantial number of Democrats to join Republicans in backing the legislation.

Representative Chip Roy, an arch-conservative Texas Republican opposed to the measure, said he did not want address whether the legislation could prompt a challenge to Mr. Johnson, considering the circumstances were nearly identical to those that led to Mr. McCarthy’s ouster.

“I don’t want to go down that road,” he said. “What we’re talking about right now is the need to get our job done and do it the right way.” Mr. Roy did praise Mr. Johnson for seeking ideas from across the spectrum of House Republicans.

“He’s been listening to everybody,” Mr. Roy said. “I commend him for that. I just think this is the wrong approach and is not one that I can support.”

Other Republicans said Mr. Johnson was making a sound choice.

“Extending the previous fiscal year’s funding is never an ideal way to govern, but the alternative is even worse,” said Representative Tom Cole, Republican of Oklahoma and the chairman of the Rules Committee. “We owe it to our constituents to keep the government open and operating to continue to provide them with the services they need and deserve.”

Senator Mitch McConnell, Republican of Kentucky and the minority leader, also lent the legislation his support.

“House Republicans have produced a responsible measure that will keep the lights on, avoid a harmful lapse in government funding and provide the time and space to finish that important work,” he said.