Democratic leader Harry Reid made the announcement at the start of the Senate session yesterday.
The deal would reopen the government until January 15 and increase the nation's borrowing authority until February 7.
Mr Reid thanked Republican leader Mitch McConnell for working out an agreement.
Earlier, both had been optimistic of reaching a deal that worked.
Driving the urgency was not only the calendar but also fears that financial markets would plunge without a settlement. Politicians were also concerned voters would punish them in next year's congressional elections. Polls show the public more inclined to blame Republicans.
Major US stock indexes rose more than 1% on optimism lawmakers were finally reaching a deal to end the weeks-long fiscal impasse.
Republican Senator Ted Cruz, who had been leading the opposition trying to attach conditions affecting president Barack Obama's healthcare reforms to any budget deal said he would not delay a vote on the bipartisan budget deal.
Mr Cruz added that he would vote against the bipartisan bill but would not use delaying tactics to stall the legislation.
He said: "The timing of the vote will make no difference in the outcome, and so I don't intend to delay the timing of the vote. I intend to vote no.
"It will be a bad deal for the American people today, tomorrow or the next day."
The Texas senator has won praise from the right-wing Tea Party and other conservatives for his actions.
The White House urged quick congressional approval of the deal to raise the debt ceiling and end the partial government shutdown.
White House spokesman Jay Carney said the deal reached by Senate leaders "achieves what's necessary" to reopen the govern-ment, remove the threat of default and move past brinkmanship.
Mr Carney said the agreement is bipartisan and that Mr Obama was looking for Congress to act so he can sign it and remove the threat to the economy.
Mr Obama's spokesman praised Mr Reid and Mr McConnell for working together.
But Mr Carney was also reluctant to be seen declaring victory on behalf of the president. The White House spokesman said: "There are no winners here. There is already a price that has been paid."
The initial fight over the healthcare law turned into a bigger argument over the debt ceiling, threatening a default that would have reverberations around the world.
The deal that emerged yesterday gives Mr Obama what he has demanded for months: a straightforward debt limit hike and government funding bill.
The deal would extend US borrowing authority until February 7, although the Treasury Department would have tools to temporarily extend its borrowing capacity beyond that date if Congress failed to act early next year.
It would also fund government agencies until January 15.
The budget deadlock led to federal agency shutdowns at the beginning of the fiscal year on October 1 as Mr Obama and his fellow Democrats stood firm against changing his flagship healthcare law.
Uncertainty over the shutdown and the debt ceiling have already taken a toll on the economy and on confidence in US assets.
Fitch Ratings warned on Tuesday night that it could cut the US sovereign credit rating from AAA, citing the political brinkmanship over raising the debt ceiling.
Richard Fisher, the hawkish president of the Federal Reserve Bank of Dallas, said "reckless" US fiscal policy was likely to force the Federal Reserve to stand its ground on monetary policy this month rather than reducing bond purchases the central bank has used to help support the economy.