NEW YORK (AP) -- U.S. stock indexes flipped to modest gains in Tuesday afternoon trading, led by a push higher for banks, to climb further into record territory. Bond yields rose after Federal Reserve Chair Janet Yellen said the central bank is still on track to raise interest rates gradually.
KEEPING SCORE: The S&P 500 rose 6 points, or 0.2 percent, to 2,334 as of 2 p.m. Eastern time, close to its highest level of the day. It was earlier down as much as 0.3 percent.
The Dow Jones industrial average rose 56 points, or 0.3 percent, to 20,468. The Nasdaq composite rose 14, or 0.2 percent, to 5,778. The Russell 2000 index of smaller U.S. stocks gained 2 points, or 0.2 percent, to 1,395. Slightly more stocks fell on the New York Stock Exchange than rose.
FED WATCH: Yellen answered questions before a Senate committee, and she said that the strengthening job market and a modest move higher in inflation should warrant continued, gradual increases in interest rates.
It was Yellen's first testimony before Congress since President Donald Trump took office. Many economists say Trump's ambitious economic program could result in higher inflation, which could force the Fed to raise rates more quickly. The central bank raised rates in December for just the second time in a decade.
Waiting too long to raise interest rates "would be unwise" and could eventually force the Fed to raise rates rapidly to catch up, Yellen said in her Congressional testimony. But she also repeated the word "gradual" to describe expectations for future increases. Investors say the Fed may raise interest rates at its meeting in March.
"Yellen seemed to have her dancing shoes on this morning and was able to steer clear of any comments that might upset the market," said Alan Gayle, senior investment strategist and director of asset allocation at RidgeWorth Investments. "In so doing, the stock market has been able to hold onto its gains."
INTEREST RATES: Bond yields moved higher immediately following Yellen's comments. The yield on the 10-year Treasury note rose to 2.47 percent from 2.43 percent late Monday. The yield on the 2-year Treasury rose to 1.23 percent from 1.21 percent, and the 30-year Treasury yield climbed to 3.07 percent from 3.03 percent.
BURNISHED BANKS: Higher interest rates can mean bigger profits for banks because they can charge more for loans. Financial stocks in the S&P 500 rose 1.1 percent, most in the index. Bank of America rose 2.9 percent, and Fifth Third Bancorp rose 2.4 percent.
Rising bond yields, meanwhile, can also mean less demand for stocks that pay big dividends. Utility stocks in the S&P 500, which are some of the market's highest yielders, fell 0.9 percent. It was the largest loss among the 11 sectors that make up the index. Real-estate investment trusts, which have relatively big dividend yields, were also weak.
BIG OPTIMISM: Stocks have been on a strong run driven by better-than-expected corporate earnings, an improving economy and expectations for more help for businesses from Washington. A gain for the S&P 500 on Tuesday would be the sixth straight, and the index is up 9.1 percent since Election Day.
A demonstration of how much optimism is feeding into markets: Small-business owners say they haven't felt this encouraged in 12 years, according to a monthly survey released by the National Federation of Independent Business on Tuesday. Optimism made a sharp turn higher following the election, and more small businesses are saying they're planning to hire.
Of course, such a high degree of excitement also leaves the possibility for disappointment if expectations aren't met.
INFLATION GAUGE: A government report on Tuesday showed that inflation at the wholesale level was 1.6 percent in January, compared with prices a year earlier. That was in line with economists' expectations, who say overall inflation appears to still be in check.
BABY, YOU CAN BUY MY CAR COMPANY: General Motors jumped $1.69, or 4.8 percent, to $37.21 following news that France's PSA Group, maker of Peugeot and Citroen cars, is exploring a deal to buy Opel, GM's money-losing European business.
MAJOR LASERS: Cynosure, which makes devices used in laser body contouring, hair removal and skin care, soared after agreeing to be bought by medical device maker Hologic. Hologic will pay $66 a share, or $1.57 billion, for Cynosure, which had about $434 million in revenue last year.
Cynosure jumped $14.43, or 28 percent, to $65.93 while Hologic fell $1.19, or 3 percent, to $38.84.
It's the second straight day where a health care giant agreed to buy a laser aesthetics company. Allergan agreed on Monday to buy Zeltiq Aesthetics, whose CoolSculpting system helps people reduce bulges of fat, for $2.48 billion.
GLOBAL MARKETS: Stocks were relatively steady across the world. In Europe, the German DAX index was virtually flat, while the French CAC 40 rose 0.2 percent and the British FTSE 100 edged down by 0.l1 percent. In Asia, the Hang Seng index in Hong Kong was close to flat, while the South Korean Kospi index dipped 0.2 percent and the Japanese Nikkei 225 index fell 1.1 percent.
COMMODITIES: Benchmark U.S. crude oil rose 36 cents to $53.29 per barrel. Brent crude, the international standard, rose 54 cents to $56.13 per barrel.
Natural gas fell 5 cents to $2.89 per 1,000 cubic feet. Gold rose 90 cents to $1,226.70 per ounce, and copper fell 4 cents to $2.75 per pound.
CURRENCIES: The dollar rose to 114.27 Japanese yen from 113.62 late Monday. The euro rose to $1.0616 from $1.0600, and the British pound dipped to $1.2469 from $1.2529.