GLOBAL MARKETS-Stocks, bonds gain, dlr dips as U.S. deal puts focus on Fed
* U.S. government passes temporary spending, borrowing bills
* Relief rally short-lived as concerns over consequences dominate
* Dollar falls against major currencies
* S&P 500 hits record closing high; IBM shares drop after results
NEW YORK, Oct 17 (Reuters) - The dollar fell while Treasuries and world stock indexes gained on Thursday as relief over a U.S. budget deal shifted investors' focus to what the fiscal saga may mean for the Federal Reserve's stimulus program.
Analysts said economic weakness resulting from the 16-day government shutdown and uncertainty over the next round of budget and debt negotiations may keep the Fed from withdrawing monetary stimulus at least until a few months into next year.
Markets had expected the Fed to announce in September that it would cut its bond purchases. When that did not happen, forecasts had switched to December.
President Barack Obama overnight signed legislation to fund the U.S. government until Jan. 15 and extend a debt ceiling deadline to Feb. 7, pulling the world's biggest economy back from the brink of a historic default.
The benchmark S&P 500 closed at a record high, even as disappointing results from International Business Machines and Goldman Sachs dragged on the Dow.
"The scare that was created by the lengthy delay in resolving the (fiscal) issue has created a situation that has taken Fed tapering off the table for a considerable period here," said Stephen Massocca, managing director at Wedbush Equity Management in San Francisco.
"That is why we saw (stock) buying over the last week and that is why we will see continued buying for a few more days."
MSCI's world equity index, tracking shares in 45 countries, hit a five-year high and was last up 1 percent at 393.56. European shares ended 0.2 percent higher.
On Wall Street, the Dow Jones industrial average slipped 2.18 points, or 0.01 percent, to close at 15,371.65. The Standard & Poor's 500 Index gained 11.61 points, or 0.67 percent, to settle at 1,733.15, a record close. The Nasdaq Composite Index rose 23.72 points, or 0.62 percent, to settle at 3,863.15.
IBM shares hit a two-year low a day after it reported a 4 percent drop in third-quarter revenue, weaker than expected. Its shares shed 6.4 percent to $174.83, while Goldman Sachs shares fell 2.4 percent to $158.32.
By pushing back expectations of Fed tapering, the deal encouraged traders to sell the dollar against the currencies of nations perceived to have less-accommodative policies.
The dollar fell against the euro to its lowest in more than eight months. The euro rose as high as $1.3681, the highest since early February and was last at $1.3667, up 1.0 percent on the day and its largest percentage gain in a month.
The dollar index was down 1.0 percent at 79.663 after earlier falling to 79.613, its lowest since Feb. 7.
The expectations over the Fed boosted Treasury prices, along with the fact that the debt deal encouraged investors to reinvest cash.
Benchmark 10-year notes rose 21/32 in price, their yields easing to 2.59 percent, the lowest since Aug. 12, and down from 2.67 percent late on Wednesday. Those yields have dropped from 3.00 percent before the Fed decided last month not to pare its bond purchases.
interest rates on ultra-short-term U.S. government debt also fell sharply. The government had been expected to exhaust its $16.7 trillion statutory borrowing limit on Thursday, raising the risk it would not meet benefit payments and debt obligations in coming days.
Fears that the Treasury Department might delay paying debt holders had made some large money market funds shed holdings of Treasury bills that mature in the second half of October into the first half of November, seen most vulnerable if the government could not increase its borrowing capacity in time.
With prompt payment on short-term U.S. debt now assured, rates on October U.S. Treasury bills due Nov. 14 last traded at 0.02 percent, down 1 basis point from late Wednesday, according to Reuters data.
The U.S. fiscal deal did little to resolve the underlying disputes that led to the crisis in the first place. The temporary nature of the agreement and longer-term worries that the debt ceiling risks would become a structural drag on the economy also left significant unease for investors.
"The deal will leave ongoing fiscal uncertainties, posing a threat to a re-run of disruptive events," said Alan Ruskin, global head of FX strategy at Deutsche Bank in New York.
The likelihood that the dispute would delay the start of the Fed's planned withdrawal of its monetary stimulus was strengthened by Dallas Fed President Richard Fisher.
In remarks prepared for delivery to the Economic Club of New York, he said: "Kicking the can down the road for a few months will not solve the pathology of fiscal misfeasance that undermines our economy and threatens our future."
The weaker dollar and the likelihood of Fed holding back on reducing monetary stimulus also boosted gold.
Spot gold rallied to a high of $1,324.06 per ounce early in the U.S. session. Later in the session, it was up 3 percent at $1,319.24, up 2.7 percent.
U.S. oil prices slid more than $2 to their lowest since early July as stocks in the Cushing, Oklahoma, oil hub began to reverse a months-long decline. U.S. crude oil dropped $1.62 to settle at $100.67 a barrel.
Brent crude fell $1.48 cents to settle at $109.11.