* House Speaker Boehner says Republicans will not block deal
* Agreement extends borrowing authority until February
* Both chambers expected to vote Wednesday
By Richard Cowan and Thomas Ferraro
WASHINGTON, Oct 16 (Reuters) - U.S. Senate leaders announced a deal on Wednesday to end a political crisis that partially shut down the federal government and brought the world's biggest economy close to a debt default that could have threatened global financial calamity.
The deal, however, offers only a temporary fix and does not resolve the fundamental issues of spending and deficits that divide Republicans and Democrats. It funds the government until Jan. 15, so Americans face the possibility of another government shutdown early next year.
U.S. stocks surged, nearing an all-time high, on news of the deal, which must still be approved by vote in the Senate and the House of Representatives. But trading volumes remained low, underscoring how the political brinkmanship in Washington has unnerved Wall Street.
A stand-off between Republicans and the White House over funding the government forced the temporary lay-off of hundreds of thousands of federal workers from Oct. 1 and created concern that crisis-driven politics was the "new normal" in Washington.
Senator John McCain, whose fellow Republicans triggered the crisis with demands that President Barack Obama's signature "Obamacare" healthcare law be defunded, said on Wednesday the deal marked the "end of an agonizing odyssey" for Americans.
"It is one of the most shameful chapters I have seen in the years I've spent in the Senate," said McCain, who had repeatedly warned Republicans not to link their demands for Obamacare changes to the debt limit or government spending bill.
House Speaker John Boehner said Republicans in the House would not block the Senate plan. Both chambers were expected to vote later in the day, clearing the way for Obama to sign it into law before Thursday, when the Treasury says it will exhaust its borrowing authority.
The deal would extend U.S. borrowing authority until Feb. 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. The deal would fund government agencies until the middle of January.
The agreement includes some income verification procedures for those seeking subsidies under the healthcare law, but Republicans surrendered on their attempts to include other changes, including the elimination of a medical device tax.
With Republicans in the House of Representatives divided on the way forward, White House spokesman Jay Carney said "we are not putting odds on anything" when asked about a House vote on the Senate plan.
RACE AGAINST TIME
While analysts and U.S. officials say the government will still have roughly $30 billion in cash to pay many obligations for at least a few days after Oct. 17, the financial sector may begin to seize up if the deal is not finalized in both chambers.
The planned votes signal a temporary ceasefire between Republicans and the White House in their latest no-holds-barred struggle over spending and deficits that has at times paralyzed both decision-making and basic functions of government.
The political dysfunction has worried U.S. allies and creditors such as China, the biggest foreign holder of U.S. debt, and raised questions about the impact on America's prestige. The Treasury has said it risks hurting the country's reputation as a safe haven and stable financial center.
Senate Majority Leader Harry Reid and Republican leader Mitch McConnell announced the fiscal agreement on the Senate floor, where it was expected to win swift approval after a main Republican critic of the deal, Senator Ted Cruz of Texas, said he would not use procedural moves to delay a vote.
The deal is seen as a victory for Obama, who held firm and refused to negotiate on changes to Obamacare, but a defeat for Republicans, who are suffering a backlash from the American public, according to public opinion polls.
It was unclear if Boehner's leadership position will be at risk in the fallout. But several Republican lawmakers suggested he may have strengthened his standing among the rank-and-file, who applaud him for standing with them.
"The Speaker got a standing ovation," after telling lawmakers during a closed-door meeting that he would put the Senate bill on the House floor, said Representative David Nunes of California, who had opposed the government shutdown strategy of his colleagues.
"He just said we live to fight another day and we all need to go out and vote for it," Nunes said.
The fight over Obamacare rapidly grew into a brawl over the debt ceiling, threatening a default that global financial organizations warned could throw the United States back into recession and cause a global economic disaster.
"Even though the market is moving up, this is a real historic event that is happening here so there is pause and concern," said Frank Davis, director of sales and trading at LEK Securities in New York.
"You are seeing a lack of activity because it's hard to invest in a market where you don't know what's around the corner."
The Dow Jones industrial average and the Standard & Poor's 500 Index ended the day up around 1.3 percent.
Fitch Ratings had warned on Tuesday that it could cut the U.S. sovereign credit rating from AAA, citing the political brinkmanship over raising the debt ceiling.
The deal announced on Wednesday would basically give Obama what he has demanded for months: A straight-forward debt limit hike and government funding bill.
A resolution to the crisis cannot come soon enough for many companies. American consumers have put away their wallets, at least temporarily, instead of spending on big-ticket items like cars and recreational vehicles.
"We're sort of 'crises-ed' out," said Tammy Darvish, vice president of DARCARS Automotive Group, a family-run company that owns 21 auto dealerships in the greater Washington area.
Many political pundits and Democratic Party politicians have predicted for weeks that a faction of Republicans in the House would drag out the crisis before making a last-minute deal.