- Amazon shares initially dragged the broader market lower after reporting a much weaker-than-expected quarterly profit.
- But stocks improved throughout the session, pushing the Dow Jones industrial average to a record close.
U.S. equities closed well off session lows on Friday investors shook off a sharp pullback from Amazon.com.
The Nasdaq composite ended 0.1 percent lower at 6,374.68 after falling as much as 0.7 percent. The tech heavy-index climbed its lows as Facebook, Netflix and Google-parent Alphabet erased earlier losses.
The Dow Jones industrial average closed 33.76 points higher at 21,830.31, notching intraday and closing highs.
The declined 0.13 percent to close at 2,472.10 after falling as much as 0.43 percent. Consumer staples led seven sectors lower.
Amazon.com shares fell as much as 4.3 percent on the back of much weaker-than-expected quarterly results. Amazon posted second-quarter earnings per share of 40 cents. Analysts polled by Reuters expected earnings of $1.42 a share. Sales, however, came in above expectations.
The stock closed 2.5 percent lower.
"What you're seeing here is a market that's being driven largely by earnings," said Matthew Peterson, chief wealth strategist at LPL Financial. "It's not surprising to see investors take profits on some bad news."
The initial pullback in tech came a day after the sector dragged the broader market lower as investors took profits off the table. The major indexes notched a record high Thursday before tech rolled over midway through the session.
"The SPX and NDX saw 'outside-down' days yesterday, increasing the likelihood of downside follow-through in the days ahead," Katie Stockton, chief technical strategist at BTIG, said in a note.
"It appears that typical August volatility may already be upon us. Initial support for the SPX is defined by the 50-day moving average, and secondary support is approximately 2400, about 3% below current levels," she said.
Tech has been the best-performing sector of the year, advancing approximately 22 percent.
"The market has been looking for growth everywhere and it's been tech that's provided it," said Tim Courtney, chief investment officer at Exencial Wealth Advisors. "We've been at this slow-and-steady growth rate and tech has been outperforming everything else."
The major indexes posted a mixed weekly performance, with the S&P and Nasdaq ending slightly lower while Dow rose 1 percent in the time period. Investors also digested a slew of earnings reports this week. Earnings season continues next week as Apple is set to report Tuesday after the close.
In economic news, U.S. economic growth for the second quarter came in-line with expectations, the Commerce Department said Friday. The U.S. economy grew at an annualized rate of 2.6 percent, matching Reuters' estimate.
Meanwhile, consumer sentiment for July topped expectations at 93.4.
The data comes just days after the Federal Reserve hinted it could start reducing its massive $4.5 trillion balance sheet in September, provided the economy behaves as expected.
Still, Phil Blancato, CEO of Ladenburg Thalmann Asset Management, thinks interest rates will remain lower for longer as inflation data remains subdued.
"As much as the Fed would want to see things go higher so they can have another arrow in their quiver, we just can't have rates at 3 or 4 percent if the data doesn't allow it," Blancato said.