Media playback is unsupported on your device Media caption The debt ceiling explained in 90 seconds

US Senate leaders have expressed optimism after a flurry of negotiations on raising the federal debt ceiling to avert a potentially disastrous default.

They were also nearing a deal to end a partial government shutdown, now in its third week, congressional sources said.

Meanwhile, Republicans in the House of Representatives unveiled their own bill, which would delay portions of President Barack Obama's health law.

The US must raise its $16.7tn (£10.5tn) borrowing limit by Thursday.

As he toured a soup kitchen for the poor in Washington DC on Monday, President Barack Obama warned that "defaulting would have a potentially devastating effect on our economy".

If... a deal is done, some will celebrate this as American democracy doing its job - raw and messy but vibrant, forcing compromise where there was none to be had

He had been due to hold talks at the White House with congressional leaders that afternoon, but the meeting was postponed to allow the parties more time to cobble together an agreement.

'Tremendous progress'

According to US media, the deal currently under discussion would fund the government until 15 January while raising the debt ceiling until early to mid-February.

Senate Democratic Majority Leader Harry Reid told the chamber on Monday evening: "We've made tremendous progress.

"We hope with good fortune... perhaps tomorrow will be a bright day. We're not there yet."

Media playback is unsupported on your device Media caption The government shutdown has cut a lifeline for dying children - drug trials

Republican Senate Minority Leader Mitch McConnell also sounded upbeat, hailing "substantial progress".

Democratic Senator Mark Pryor told CNN he was "pretty confident" an agreement would be announced on Tuesday afternoon, but said some Republicans "almost want a shutdown".

"They almost want to see us break the debt ceiling," he said.

Republican Senator Richard Shelby called the proposed short-term agreement a "temporary fix".

"It's punting because no one, Democrats, Republicans, wants to face up... to the tough reality that we're in," he told Associated Press news agency.

Meanwhile, on Tuesday morning leaders of the Republicans who control the House of Representatives announced they intended to pursue their own debt ceiling and government funding bill.

Their bill would alter the Affordable Care Act, Mr Obama's signature healthcare overhaul, delaying a tax on medical devices for two years and requiring income verification before insurance customers were eligible for government subsidies.

Under that proposal, the government would be funded through 15 January and the debt ceiling lifted until 7 February.

Mr Obama and congressional Democrats have said they are unwilling to negotiate over the Affordable Care Act while the government remains shut and the threat of a debt default looms.

'Surrender caucus'

By Tuesday morning Democrats appeared to have fended off Republican attempts to force any major changes to President Obama's signature healthcare law.

Conservative hardliners were initially vocal in demanding that the White House agree to delay or eliminate funding for the Affordable Care Act.

However, Senate Republicans are still reportedly pushing for slight modifications to the law. According to US media, they want stricter measures to verify the incomes of those seeking health insurance subsidies.

Other measures include the suspension of a per-employee tax paid by companies and labour unions who participate in the health law, and the establishment of a committee to negotiate a longer-term budget.

Media playback is unsupported on your device Media caption President Obama also said there had been "progress" in negotiations

Even if a deal is reached in the Senate, it is unclear whether Congress could act in time to pass legislation that would avert the 17 October default deadline.

Hardline conservatives such as Texas Republican Ted Cruz could use Senate rules to stonewall a vote.

In the House of Representatives, a deal could meet fierce resistance from the Tea Party-aligned Republicans.

One of those conservative hardliners, Kansas Representative Tim Huelskamp, was quoted by the New York Times as labelling his upper chamber colleagues "the Senate surrender caucus".

"Anybody who would vote for that [Senate deal] in the House as Republican would virtually guarantee a primary challenger," he said.

Republicans have taken the brunt of blame for the latest fiscal cliffhanger to cripple Capitol Hill, according to opinion polls.

A Washington Post/ABC News survey on Monday found 74% of voters were unhappy with congressional Republicans' handling of the standoff, compared with a 53% disapproval rating for President Obama.

Some in the party have voiced concern that the affair could damage its prospects in next year's midterm elections.

Economists and bankers have warned for weeks of dire consequences should Congress fail to reach an agreement on raising the nation's debt ceiling.

The US Treasury has been using what are known as "extraordinary measures" to pay its bills since the nation reached its current debt limit in May.

Those methods will be exhausted by 17 October, US Treasury Secretary Jack Lew has said.

Meanwhile, the government remains partially shut down because Congress failed to agree on funding by a 1 October deadline.

The impasse has closed a swathe of federal services and left hundreds of thousands of employees out of work.