U.S. stocks ended lower on Friday as disappointing earnings from Snap spooked investors and shares in social media and ad tech firms dropped, offsetting gains from card issuer American Express following an upbeat forecast.

Still, all three major indexes posted weekly gains despite Friday's losses with the tech heavy Nasdaq closing out the week 3.3% higher. The S&P 500 advanced 2.4%, and the Dow gained 2%.

Snapchat owner posted its weakest-ever quarterly sales growth as a public company, sending Snap Inc's shares down nearly 40%, while Twitter Inc reversed earlier losses to add 0.8% following a surprise fall in revenue.

Other online companies that depend heavily on ads, such as tech giants Meta Platforms Inc and Alphabet Inc tumbled 7.6% and 5.6%, respectively, weighing on the Nasdaq.

Meta and Alphabet are set to post their earnings next week, along with mega-cap peers, including Apple Inc, Microsoft Corp and Amazon.com Inc.

The S&P 500 communication services and information technology tumbled 4.3% and 1.4%, respectively, leading declines among the index's 11 sectors.

The Dow Jones Industrial Average fell 137.61 points, or 0.43%, to 31,899.29, the S&P 500 lost 37.32 points, or 0.93%, to 3,961.63 and the Nasdaq Composite dropped 225.50 points, or 1.87%, to 11,834.11.

"Earnings are coming in less bad than feared, but they're deteriorating from what we got used to and accustomed to over the last several quarters," said Bob Doll, CIO at Crossmark Global Investments.

With 106 of the S&P 500 companies having reported earnings through Friday morning, 75.5% have topped analyst expectations, below the 81% beat rate over the past four quarters, according to Refinitiv data.[L1N2Z31SC]

All eyes are on the Federal Reserve's meeting and second-quarter U.S. gross domestic product data next week. While the U.S. central bank is expected to raise interest rates by 75 basis points to curb runaway inflation, the GDP data is likely to be negative again.

Meanwhile, a survey on Friday showed that U.S. business activity contracted for the first time in nearly two years in July, deepening concerns about an economy stunted by high inflation, rising interest rates and dwindling consumer confidence.

"Economic data is coming in weaker.. kind of confirming the fact that a recession is highly likely over the next 12 months. And the markets is trying to figure out what that looks like with economic growth slowing significantly [and] the Fed in the midst of pretty aggressive tightening fiscal," said Megan Horneman, chief investment officer at Verdence Capital Advisors in Hunt Valley, Maryland.

Verizon Communications Inc tumbled 6.8% after announcing it cut its annual adjusted profit forecast as inflation weighs. American Express Co rose 1.9% on strong earnings and an increased revenue forecast.

Volume on U.S. exchanges was 10.38 billion shares, compared with the 11.53 billion average for the full session over the last 20 trading days.

Declining issues outnumbered advancing ones on the NYSE by a 1.43-to-1 ratio; on Nasdaq, a 2.49-to-1 ratio favored decliners.

The S&P 500 posted 1 new 52-week highs and 31 new lows; the Nasdaq Composite recorded 32 new highs and 74 new lows.