Financial companies led U.S. stock indexes up Thursday, nudging the Nasdaq composite index to a record high.
The latest gains came as the stock market continued to trade mostly in a narrow range in the absence of major new economic data and ahead of next week's meeting of Federal Reserve policymakers.
Speculation that the Fed will raise interest rates helped boost financial stocks for the second day in a row. Higher interest rates enable banks and credit card issuers to charge more for loans, which boosts profits.
Utilities and consumer goods companies were among the biggest decliners. Energy stocks fell as crude oil prices declined.
The Standard & Poor's 500 index inched up 0.65 of a point to 2,433.79. The Dow Jones industrial average rose 8.84 points to 21,182.53. Both indexes remain slightly below their record highs set last Friday.
The Nasdaq climbed 24.38 points to 6,321.76. Small-company stocks fared better than the rest of the market. The Russell 2000 index jumped 18.94 points to 1,415.61.
Bond prices fell. The 10-year Treasury yield rose to 2.19% from 2.18%.
Stocks wavered between small gains and losses for much of the day as investors tuned in to watch former FBI Director James Comey testify before the Senate Intelligence Committee as part of the investigation into Russian meddling in the U.S. presidential election.
In his testimony, Comey's first public statements since his May 9 dismissal, he said President Trump's administration spread "lies" about him and the FBI after Trump abruptly fired him in May.
Stock indexes barely budged throughout the hearing.
"Today did not turn into a market event, nor did it accelerate the path toward further progress on the legislative and administrative agenda," said Bill Northey, chief investment officer at U.S. Bank Wealth Management.
Investors have been looking for more progress out of the White House on its agenda to cut taxes, increase infrastructure spending and implement other business-friendly policies.
The Republican-led House took steps Thursday to advance Trump's pledge to ease regulations on businesses by taking a vote on legislation that would undo the stricter banking rules that took effect after the 2008 financial crisis. That helped lift bank stocks.
Goldman Sachs Group ticked up 1.4% to $218.76. JPMorgan Chase rose 1.2% to $84.95. Regions Financial climbed 3.2% to $14.03.
Traders also welcomed news that members of the Nordstrom family are considering taking the retailer private.
Like Macy's and other big department store chains, Nordstrom has struggled to cope with competition from online retailers. The company, which has 354 stores in the U.S. and Canada, has seen its stock tumble by half since early 2015. On Thursday, the stock jumped 10.3% to $44.63.
Valeant Pharmaceuticals International advanced 9% to $13.26 after the drugmaker said it will sell its iNova Pharmaceuticals business to two private equity companies for $930 million.
Several companies that reported improved earnings or outlooks also traded higher.
Verint Systems rose 3.2% to $43.45 after the maker of software for analyzing intercepted communications had a strong first quarter.
Investors cheered Alibaba Group Holding's latest revenue forecast. Shares of the Chinese e-commerce company leaped 13.3% to $142.34.
Some companies failed to impress traders.
Urban Outfitters slid 10.3% to $16.35 after the retailer said sales at older stores are running lower than expected this month. That followed weak sales in May.
Benchmark U.S. crude wavered for much of the day before sliding 8 cents to settle at $45.64 a barrel in New York. Brent crude, used to price international oils, fell 20 cents to $47.86 a barrel in London. Wholesale gasoline held steady at $1.49 a gallon. Heating oil rose 1 cent to $1.42 a gallon. Natural gas rose 1 cent to $3.03 per 1,000 cubic feet.
The dollar rose to 109.94 yen from 109.83 yen Wednesday. The euro fell to $1.1222 from $1.1252.
In metals trading, gold fell $13.70 to $1,279.50 an ounce. Silver fell 21 cents to $17.41 an ounce. Copper rose 6 cents to $2.61 a pound.
European stock markets were mixed after the European Central Bank kept its stimulus program unchanged. ECB President Mario Draghi said Thursday that risks to the European economic recovery have diminished. Germany's DAX rose 0.3%, while France's CAC 40 slipped 0.2%. Britain's FTSE 100 fell 0.4% as Britain went to the polls in a general election.
In Asia, Japan's benchmark Nikkei 225 index lost 0.3%, South Korea's Kospi edged up 0.2% and Hong Kong's Hang Seng rose 0.3%. Australia's S&P/ASX 200 advanced 0.2%.
2:40 p.m.: This article was updated with closing prices, context and analyst comment.
10:35 a.m.: This article was updated after Comey's testimony.
7:40 a.m.: This article was updated with market prices and context.