Apple Inc. on Tuesday is expected to post a record spring-quarter profit, as customers continue to embrace new iPhones and other devices and investors look for signs the company’s pandemic-induced success will continue.

Analysts predict the Cupertino, Calif., tech giant will post almost $17 billion in profit for the three-month period that ended in June, the best fiscal third quarter in its 45-year history. Revenue is expected to rise 23% from a year earlier to $73 billion.

The company is on pace for its best fiscal year ever, with a profit of $86 billion for the 12-month period ending in September, according to an average forecast of analysts surveyed by FactSet. That would be about 51% better than last year’s record. A year ago, those analysts had predicted what now seems like a paltry 11% gain.

Investors came into 2021 expecting big things, thanks to the iPhone 12 lineup and its 5G cellular connectivity. Chief Executive Tim Cook has defied even lofty expectations, benefiting from two developments: the first iPhone in three years with technological advances perceived by longtime customers as worthy of upgrading for, and stronger-than- expected demand for laptops and iPad tablets by workers and students stuck at home during the coronavirus pandemic.

Sales from iPhones are expected to rise 29% to $34 billion during the April-to-June period compared with a year ago, according to analysts surveyed by FactSet.

While iPhone sales traditionally fall off in the year after a big launch, the excitement of 5G may carry through fiscal 2022. “With close to 1 billion iPhones in use globally, the 5G upgrade opportunity remains significant, with current U.S. carrier promotions an added tailwind,” William Power, an analyst for Robert W. Baird & Co., wrote in a note to investors this week.

By the end of September, Apple’s total iPhone revenue is expected to rise 36% compared with all of fiscal 2020 and stay at roughly the same level in 2022 before declining a bit in 2023, analysts predict.

A top concern for investors when Mr. Cook addresses Wall Street analysts during a public conference call after the markets close Tuesday will be his outlook for the current quarter and details about how prepared the company is to handle the microprocessor shortage roiling the tech and auto industries.

So far, Apple has been able to avoid big disruptions. But in April, the company cautioned that the falloff in sales in the third quarter compared with the second quarter would be greater than normal. At the time, Chief Financial Officer Luca Maestri attributed this, in part, to an expected chip shortage, hurting sales by as much as $4 billion.

Sales in fiscal 2019 fell 7% between the second and third quarters while declining 13% in those periods in 2018. The outlier was last year when sales fueled by pandemic buying rose 2.4%.

Part of the drop between this year’s quarters is because of stronger-than-usual demand for the iPhone in the quarter that ended in March. The launch of the iPhone 12 lineup with 5G cellular connectivity was delayed in 2020 because of the outbreak of Covid-19.

During the pandemic, Apple stopped giving detailed quarterly guidance about sales expectations. Still, investors and analysts will be closely monitoring Mr. Cook’s language to gauge his confidence as the company heads toward the expected September launch of its latest iPhone. The company has delayed plans to pull workers back into the office until at least October from September amid growing cases of Covid-19.

Write to Tim Higgins at Tim.Higgins@WSJ.com