Last Updated Jul 22, 2015 6:00 PM EDT
Both companies delivered disappointing quarterly results or outlooks the night before, setting the stage for the sell-off in the technology sector.
"Apple is the biggest publicly traded company in the world, so it's going to have a big impact on the indices," noted Erik Davidson, chief investment officer at Wells Fargo Private Bank.
The slide wasn't that broad, however. Financial and utilities stocks were among the big gainers. And homebuilders got a boost from a report indicating U.S. home sales surged last month to the fastest pace in more than eight years.
The Dow Jones industrial average slid 68.25 points, or 0.4 percent, to close at 17,851.04. The Standard & Poor's 500 index lost 5.06 points, or 0.2 percent, ending at 2,114.15.
The Nasdaq composite shed 36.35 points, or 0.7 percent, to finish at 5,171.77. The tech-heavy index, which hit a new high on Monday, remains the best-performing index for the year. It's up 9.2 percent, while the S&P 500 is up 2.7 percent and the Dow is essentially flat.
Five of the 10 sectors in the S&P 500 index declined, led by a 1.6 percent drop in technology stocks. Financials led the gainers, rising 0.7 percent.
The major stock indexes declined from the get-go as traders reacted to weaker showings late Tuesday from Microsoft, Yahoo (YHOO) and Apple.
Yahoo posted a nearly $22 million loss driven by soaring commissions paid to its partners and flat sales. The stock slipped 49 cents, or 1.2 percent, to $39.24.
Microsoft's slide was more pronounced at 3.7 percent. The company reported a hefty quarterly loss stemming from an expense of $8.4 billion related to its purchase of the Nokia phone business over a year ago. The stock lost $1.74 to $45.54.
Apple fared the worst, shedding 4.2 percent after management gave a cautious outlook for the current quarter and didn't provide much detail on how the company's new smartwatch was doing. Apple's latest results also stirred investor concerns about a slowdown in the growth of iPhone sales. The stock fell $5.53 to 125.22.
Despite its size, Apple's latest results don't necessarily speak to the overall health of the economy or corporate America, Davidson said.
"Do iPhone sales tell us a lot about the broader economy and the markets, or does it tell us more about Apple? It probably tells us more about Apple," Davidson said. "In general, you have a U.S. economy that is recovering. Earnings are going fairly well."
Several other companies, including consumer reviews service Angie's List (ANGI), Tupperware Brands (TUP) and Packaging Corp. of America (PKG) reported earnings or revenue that fell short of Wall Street's expectations.
Shares in Whirlpool vaulted $12.15, or 7.3 percent, to $178.36, while Chipotle gained $52.75, or 7.8 percent, to $725.82.
Investors have their eye on company earnings and outlooks to get a sense of how the economy is doing. Of the roughly 104 companies that have reported so far, about 70 percent of them delivered results that beat Wall Street estimates, according to S&P Capital IQ.
In a light week of economic news, the market got encouraging data on the housing market.
The National Association of Realtors said that sales of previously occupied homes climbed 3.2 percent in June to a seasonally adjusted annual rate of 5.49 million. That's the highest pace in more than eight years and indicates that demand has eclipsed the amount of homes available for sale. Homebuilder shares got a bump from the report.
"It may be tough to keep that pace, but it really shows how much the housing market is going in the right direction, and along with employment, there's a lot of hope for the economy," said JJ Kinahan, TD Ameritrade's chief strategist.
The price of oil closed below $50 for the first time since April after the government reported a surprise increase in U.S. crude inventories.
Oil inventories typically shrink this time of year because demand is high, and analysts had expected a decline of 1.9 million barrels, according to Platts. Instead, crude supplies increased by 2.5 million barrels, according to the Energy Information Administration's weekly status report.
Benchmark U.S. crude fell $1.67 to close at $49.19 a barrel in New York. Brent crude, a benchmark for international oil used by many U.S. refineries, fell 91 cents to close at $56.13 a barrel in London.
In other futures trading on the New York Mercantile Exchange, wholesale gasoline fell 5.3 cents to close at $1.868 a gallon. Heating oil fell 0.6 cents to close at $1.672 a gallon. Natural gas rose 1.5 cents to close at $2.897 per 1,000 cubic feet.
Precious and industrial metals futures fell.
Gold lost $12 to $1,091.50 an ounce. Silver gave up six cents to $14.71 an ounce and copper declined five cents to $2.43 an ounce.
Bond prices didn't move much. The yield on the 10-year Treasury note held steady at 2.33 percent.