Trader Robert Charmak, left, works on the floor of the New York Stock Exchange Tuesday, Oct. 15, 2013. World stock markets fluctuated between gains and losses Wednesday Oct. 16, 2013 as a deadline for divided U.S. lawmakers to agree on a higher government borrowing limit drew ever closer. NEW YORK (AP) - A last-minute Senate agreement to avoid a U.S. default and reopen the government boosted the stock market Wednesday, pushing the Standard & Poor's 500 index close to a record high. Senate leaders announced the agreement following a partial, 16-day government shutdown. Without a debt deal, the U.S. will hit a Thursday deadline after which it could no longer borrow money to pay its bills, increasing the chance of a default on government debt. The Dow Jones industrial average rose 174 points, or 1.2 percent, to 15,342 as of 2:08 p.m. Despite the gridlock in Washington, investors have stayed largely calm throughout the twists in the current fiscal drama in Washington. Even before Wednesday's news, the S&P 500 and the Dow were up for the month. "The market believed in and anticipated a resolution," said Doug Cote, chief market strategist at ING Investment Management. However, we are nonetheless pleased that we got it. It's a relief. The Standard & Poor's 500 index rose 19 points, or 1.2 percent, to 1,718, just seven points below its all-time high of 1,725 set Sept. The Nasdaq composite rose 42 points, or 1.1 percent, to 3,835. The Senate proposal called for extending the government's borrowing authority through Feb. 7 and reopening the government through Jan. 15. The market for U.S. Treasury bills reflected relief among bond investors. The yield on the one-month T-bill dropped to 0.13 percent from 0.40 percent Wednesday morning, an extraordinarily large move. The decline means that investors consider the bill to be less risky. The yield on the 10-year Treasury note edged down to 2.68 percent from 2.74 percent Tuesday. Yields on longer-term U.S. government debt haven't moved as much as those on short-term debt because investors believed that the government would work out a longer-term solution. The feeling among stock traders in recent days was that panicking and pulling money out of stocks could leave them missing out on a rally after Washington finally came to an agreement. Investors are also becoming inured to Washington's habit of reaching budget and debt deals at the last minute. "Investors have become, unfortunately, accustomed to some of the dysfunction," said Eric Wiegand, a senior portfolio manager at U.S. Bank. It's become more the norm than the exception. In the summer of 2011, the S&P 500 index plunged 17 percent between early July and early August as lawmakers argued over raising the debt limit and Standard & Poor's cut the U.S. credit rating from 'AAA,' its highest ranking. The market later recovered. Stocks also slumped in the last two weeks of 2012 as investors fretted that the U.S. would go over the "fiscal cliff" as lawmakers argued over a series of automatic government spending cuts. Stock also rebounded and embarked on a strong rally that has pushed the S&P 500 up almost 21 percent this year. Some were glad that investors could now turn their focus back to the traditional drivers of the stock market such as company earnings, the economy and interest rates rather than worrying whether the latest dispatch from Washington would shake stocks. "It's a little bit silly in the short term for markets to go down so much on press conferences and then to go up so much on rumors," said Brad Sorensen, director of market and sector research at the Schwab Center for Financial Research. We've urged investors to pull back a little bit and look at the longer term. Mattel gained 83 cents, or 2 percent, to $42.38 after the company's third-quarter net income rose thanks to high demand for dolls like Monster High, Barbie and American Girl. The results were better than Wall Street analysts had forecast. Bank of America rose 30 cents, or 2.1 percent, to $14.54 after the second-largest U.S. bank reported a surge in third-quarter earnings. Stanley Black & Decker plunged $12.90, or 14.5 percent, to $76.54 after the company lowered its profit forecast for the year, citing slower growth in emerging markets and a hit from the U.S. government shutdown.