Investors were taking a wait-and-see approach Monday as the corporate earnings season gets underway in earnest this week.
The S&P 500 gained 0.2%, squeaking past its record high by one point. The Dow Jones industrial average inched up nearly 2 points. The Nasdaq added 0.3%.
All three indexes are up roughly 19% so far this year.
Nearly 160 companies in the S&P 500 are slated to report quarterly results this week. Among the Dow components on deck are AT&T, Boeing, and 3M.
Broad boost from earnings: While it's still early, second-quarter earnings have come in better than many had feared.
The results so far "have provided support to stock prices and given a boost to investor sentiment," said John Stoltzfus, chief investment strategist at Oppenheimer Asset Management, adding that expectations had been cut in the run-up to the reports.
Of the 104 S&P 500 companies that reported results through Friday, 66% have beat analysts' expectations, according to S&P Capital IQ.
Much of that performance was driven by the financial services sector, which benefited from robust capital market activity in the second quarter.
McDonald's said Monday that global sales and earnings rose in the second quarter, but profits fell short of analysts' expectations. The fast food chain also warned that sales will be "challenged" in the second half of the year. McDonald's was the biggest drag on the Dow Monday.
Kimberly-Clark, producer of Kleenex, Huggies, Kotex, Depends and Scott products, reported an increase in quarterly profit but sales were flat.
Six Flags shares fell after the amusement park operator said earnings slumped 26% in the second quarter. The company is also struggling with the fallout from a fatal roller coaster accident over the weekend.
Tech results in focus: This week, a number of big technology companies are slated to report, including Apple, Facebook and Amazon.
Following disappointing results from Google and Microsoft last week, investors are eager to see how other tech companies have fared. Apple, which can have an out-sized impact on the broader market, is expected to report a sharp drop in profits.
After the market closed Monday, Netflix's reported earnings of 49 cents per share, topping analysts' expectations. But the wide-ranging earnings guidance spooked investors a little in after-hours trading.
Despite the positive tone to last week's earnings reports, many investors remain concerned about the tepid pace of revenue growth, said Dan Greenhaus, chief market strategist at BTIG.
"Revenue growth concerns are paramount, with some wondering about the future path of earnings if revenue growth doesn't accelerate," Greenhaus wrote in a note to clients.
He said about half of the companies that have reported so far have beat revenue expectations. While that sounds pretty good, it's below average.
In other corporate news, Yahoo! announced that it will repurchase 40 million Yahoo shares from long-time backer Third Point Capital. The hedge fund, run by activist investor Dan Loeb, will retain a small stake.
UBS agreed to pay about $745 million to settle a case with the U.S. Federal Housing Finance Agency over improperly selling mortgage-backed securities to Fannie Mae and Freddie Mac in the United States.
Gold spike, housing slump: Shares of mining companies were higher as the price of gold rose more than 2% to trade above $1,300 an ounce.
Barrick Gold, Newmont Mining, Kinross Gold all gained about 4%.
In economic news, the National Association of Realtors said new home sales fell 1.2% in June. The group blamed higher mortgage rates in certain high-end markets.
Shares of homebuilders were under pressure. Hovnanian, D.R. Horton and Lennar all fell about 2%.
World markets: In Europe, the major indexes ended narrowly mixed.
Asian markets also closed out the day in mixed territory. Japan's Nikkei advanced by 0.5% after voters rewarded the architects of Abenomics with a sweeping electoral victory.