Apple made its biggest jump in six months on Wednesday, helping send the Dow Jones industrial average above 22,000 points for the first time.
Apple's latest profit and revenue were better than analysts expected, and the company's strong sales forecast suggests it is confident the next iPhone will reach the market on time.
The technology giant's stock climbed to an all-time high, and when some other technology companies, utilities and industrial firms joined it, that was just barely enough to take the Standard & Poor's 500 index higher as well.
Much of the rest of the market was mixed, however, and most of the companies listed on the New York Stock Exchange fell.
Cinema companies tumbled after AMC Entertainment said US box office grosses are sinking.
Health care companies turned lower as prescription drug distributor Cardinal Health gave a weak forecast, mostly because of falling generic drug prices.
Retailers and shopping mall operators also sank.
The Dow average rose 52.32 points, or 0.2%, to 22,016.24. Apple was responsible for 48 of those points.
The Standard & Poor's 500 index, a much broader market measure used by most professional investors, added 1.22 points, or less than 0.1%, to 2,477.57.
The Nasdaq composite inched down 0.29 points to 6,352.65. The Russell 2000 index of smaller-company stocks shed 15.43 points, or 1.1%, to 1,412.90.
"The market's not forgiving for any company that misses" Wall Street projections, said Edward Jones investment strategist Kate Warne.
Overall, she said investors seem pleased that companies are reporting rising profits based on greater revenue and strong demand instead of stock buybacks and other financial moves.
Apple climbed 7.09 dollars, or 4.7%, to 157.14 dollars. That was the first time it set a record high in almost three months.
Its stock had slipped recently in part because some investors were worried that production problems would delay the launch of the next iPhone, which would have hurt the company's fourth-quarter sales.
But Apple's revenue estimate was better than expected and greater than last year, when the iPhone 7 was released.
Cinema operators and studios declined after AMC said US box office receipts dropped 4.4% in the second quarter, and it expects the third quarter to be difficult as well. AMC it also taking a charge of 200 million dollars because its investment in another chain, National CineMedia, lost value.
The company is also planning to slash costs by cutting operating hours and staff levels while trying to boost revenue with new pricing plans and discounts.
AMC dropped 5.60 dollars, or 26.9%, to 15.20 dollars and Cinemark Holdings lost 1.94 dollars, or 5.9%, to 37.82 dollars. Walt Disney fell 1.04 dollars, or 1.8%, to 108.67 dollars. CBS gave up 1.27 dollars, or 1.9%, to 64.81 dollars and Viacom dipped 1.44 dollars, or 4.1%, to 34.09 dollars.
Retailers also stumbled, which hurt smaller, U.S.-focused companies.
Big 5 Sporting Goods reported a weak profit and sales that fell short of analysts' forecasts.
Big 5 said sales of firearms, camping and water sports equipment fell, and its estimates for the current quarter fell short of Wall Street's estimates. Its stock shed 85 cents, or 7.8%, to 10.10 dollars.
Car retailer AutoNation also had a disappointing quarter as prices for used cars fell. It dropped 3.01 dollars, or 7.2%, to 38.96 dollars.
Shopping centre operator GGP slid 1.13, or 4.9%, to 21.91 dollars after it said it does not plan to sell itself, and department store chain Nordstrom drooped 2.45 dollars, or 5%, to 46.49 dollars on reports the Nordstrom family might not succeed in taking the struggling company private.
Prescription drug distributor Cardinal Health forecast a much smaller profit than analysts expected.
The company said it was being hurt by lower prices for generic drugs, as well as smaller increases in the prices of brand-name drugs and the loss of a contract with the Safeway grocery chain. The company's stock lost 6.34 dollars, or 8.2%, to 70.99 dollars.
Genetic tools company Illumina raised its projections for the rest of the year after demand for its NovaSeq genetic sequencing system was better than it expected. Its stock gained 25.55 dollars, or 14.8%, to 197.85 dollars.
Benchmark US crude added 43 cents to close at 49.59 dollars a barrel in New York.
Brent crude, the international standard, picked up 58 cents to close at 52.36 dollars a barrel in London.
In other energy trading, wholesale petrol fell two cents to 1.64 dollars a gallon, heating oil rose two cents to 1.66 dollars a gallon and natural gas held steady at 2.81 dollars per 1,000 cubic feet.
Bond prices inched lower. The yield on the 10-year Treasury note rose to 2.27% from 2.25%.
Gold fell one dollar to 1,278.40 dollars an ounce. Silver decreased three cents to 16.73 dollars an ounce. Copper stayed at 2.88 dollars a pound.
The dollar rose to 110.61 yen from 110.30 yen. The euro edged up to 1.1860 from 1.1801 dollars.
Germany's Dax lost 0.6% and the CAC 40 in shed 0.4%.
Britain's FTSE 100 gave up 0.2%.
Japan's Nikkei 225 rose 0.5% and South Korea's Kospi gained 0.2%. Hong Kong's Hang Seng index advanced 0.2%.