WASHINGTON — Congress will confront a potentially devastating financial crisis in September as lawmakers scramble to avert a government shutdown and prevent the nation from defaulting on its debt for the first time in history.

Treasury Secretary Steven Mnuchin has warned congressional leaders that the government will run out of money to pay its bills by Sept. 29 unless lawmakers vote to raise the debt limit.

Funding to keep the government open is set to expire two days later, on Oct. 1, unless Congress can agree on a spending deal during the approximately three weeks it will be in session in September.

"September is going to be a very difficult month. Obviously all of this is coming into play right away," House Freedom Caucus Chairman Mark Meadows, R-N.C., told reporters before the House adjourned for its August recess.

The debt limit, set by Congress, is the legal amount the U.S. Treasury can borrow to pay the government's existing bills, including Social Security and Medicare benefits, military salaries, tax refunds, interest on the national debt, and other obligations.

The government has never defaulted on its debt before, and no one knows for sure what the impact would be. However, economists warn that it could plunge the U.S. back into recession and spark a global economic crisis.

"It is critical that Congress act," Mnuchin wrote in a July 28 letter to congressional leaders.

Read more:

Congress' next big battles: Passing spending bills, raising the debt limit

Here's what the government spending deal will and won't fund

What's the debt limit and why is Congress about to raise it again?

Mnuchin began taking "extraordinary measures" to conserve cash in March, when the debt hit the current statutory limit of about $20 trillion. Those measures include deferring investments in federal employee pension funds.

"The debt ceiling isn’t a game of chicken," said Maya MacGuineas, president of the non-partisan Committee for a Responsible Federal Budget. "It should be raised as soon as possible to ensure continued confidence in our economic system here at home and around the world."

Congressional action is complicated by threats by the conservative House Freedom Caucus to oppose any increase in the debt limit that is not tied to cuts in spending.

"We demand that any increase of the debt ceiling be paired with policy that addresses Washington’s unsustainable spending by cutting where necessary, capping where able, and working to balance in the near future," the caucus, which is made up of about 40 Republicans, said in a statement.

But Democrats said they will only support a "clean" increase with no strings attached, and GOP leaders will need their votes to raise the debt ceiling since conservatives are balking.

"Republicans have a responsibility to work with Democrats to make sure our nation pays its bills on time — not take us to the brink of default by insisting on trying the debt limit to partisan poison pill measures," Democratic Whip Steny Hoyer of Maryland said Tuesday.

Democratic votes in the Senate also will be needed to pass a spending deal to keep the government funded beyond Sept. 30, when the 2017 fiscal year ends.

However, Democrats have come out strongly against a provision in a security-themed spending package passed by the House last week that includes $1.6 billion to begin construction of a wall along about 70 miles of the 2,000-mile U.S.-Mexico border. The wall was one of President Trump's major campaign promises, although he also pledged that Mexico would pay for the barrier.

"This reckless bill would break through the budget caps and waste billions on a misguided and ineffective border wall," Sen. Patrick Leahy of Vermont, the senior Democrat on the Senate Appropriations Committee, said Tuesday. "In the Senate, you need 60 votes. This package will not have 60 votes."

With little time left to work out a deal, there is a growing possibility that Congress will once again have to pass a stopgap spending bill in September to keep the government open for a few weeks or months until a longer-term agreement can be reached.