The US government is hurtling toward an Oct. 1 shutdown as Senate leaders and House moderates work to try to at least shorten a disruptive federal funding lapse.

Senate Republican and Democratic negotiators are nearing a deal on a short-term spending measure intended to keep the government open after Oct. 1, according to people familiar with the talks.

But House Speaker Kevin McCarthy would face a tough choice on whether to even permit a vote on the emerging Senate deal in the face of demands from Republican hardliners.

At the same time, moderate House Republicans are prepared to join with Democrats to invoke a rarely used procedure to force a vote on a bipartisan temporary funding plan. But it’s a time-consuming tactic and they won’t be able to do so before the Sunday shutdown deadline.

The parallel efforts signal that a shutdown, which is a near-certainty, may be short-lived. Any agreement, however, will require compromise and some funding — including new aid to Ukraine — is increasingly unlikely to make the final cut.

Amid the political tumult, Moody’s Investors Service, the only remaining major credit grader to assign the US a top rating, signaled its confidence in the US is wavering. It cited “weakness of US institutional and governance strength.”

So far, McCarthy has been unable to muster enough Republican votes for a rival stopgap measure that would cut spending by 27% and change border policies, something that the White House and Senate Democrats would reject. If McCarthy puts the Senate bill up for a vote, conservative hardliners have threatened to try to oust him.

The Senate legislation would extend funding for 45 days and isn’t likely to include assistance to Ukraine for its continuing fight against Russia, people familiar said, asking not to be named discussing private negotiations. That’s a shorter time frame than the extension into December that Democrats originally wanted but could help get the bill through the House.

It remains unclear whether the Senate bill will include emergency disaster aid. That and the Ukraine funds, sought by the White House, have not been embraced by some House Republicans, particularly the Ukraine package.

Senate negotiators worked through the weekend and into Tuesday. The House returns on Tuesday after a weekend break extended to mark Yom Kippur.

In the House, moderate Republicans are preparing to join with Democrats on a discharge petition. The procedure was adopted by the House in 1910 as a check on the speaker’s power and would force a vote on a bill without his approval. Discharge petitions have been successfully deployed just twice this century.

Given their narrow majority, only five Republicans must join with Democrats to bring it about. Thirty-two Republicans have already signed onto a bipartisan bill to fund the government through Jan. 11 and provide military aid to Ukraine.

Representatives Mike Lawler and Marc Molinaro, both New York Republicans who represent areas Democrat Joe Biden carried in the last presidential election, already have publicly threatened to join Democrats in such a petition, and other GOP moderates are ready to do so.

The discharge petition, last deployed successfully in 2015, can be used to force a vote on that within nine “legislative days” when Congress is actually in session.

McCarthy would be under heavy pressure from ultraconservatives to block a vote on reopening the government. Hardliners have privately threatened to oust him if temporary funding is approved through a discharge petition, a House GOP leadership official said.

Yet some of the tools to block a discharge petition would be politically risky.

Russ Vought, a former Donald Trump budget director who is advising hardliners, said in a social-media post that McCarthy could keep the House in recess to prevent the magic nine legislative days from being reached. But a break for lawmakers would be hard to defend while federal employees go without pay and government services are disrupted.

This article was provided by Bloomberg News.