FedEx Corp. founder Fred Smith is stepping down as chief executive of the company he started more than 50 years ago with a few planes and built into a global delivery network that moves millions of packages a day.

Mr. Smith, 77 years old, is handing the CEO role to President and Chief Operating Officer Raj Subramaniam.

Mr. Smith, who is also chairman of the FedEx board, will transition to executive chairman on June 1, when the leadership change will take place.

Mr. Subramaniam, a company veteran of more than 30 years, is being named CEO-elect immediately. The 56-year-old has steered FedEx’s embrace of online shopping and was seen as Mr. Smith’s likely successor after he was named the No. 2 executive and joined the board in early 2020.

In a letter to staff Monday, Mr. Smith said that he timed the appointment of his successor to the company’s 50th anniversary and that elevating Mr. Subramaniam would allow the CEO-elect to oversee the development of the business plan for the next fiscal year.

“While I am immensely proud of what we have created, I don’t like to look backward,” Mr. Smith wrote. “We must always be looking ahead.”

Mr. Smith invented the concept of express delivery when he founded Federal Express in 1971 by forming an airline network that flew time-critical packages overnight.

The concept was spelled out in a term paper during his time at Yale University.

The Memphis, Tenn.-based company employs more than 600,000 people and had $92 billion in revenue last year.

Lately, FedEx has been trying to capitalize on changing shopping habits driven by the e-commerce boom.

FedEx started to split ways in 2019 with Amazon.com Inc., which was building up its own logistics operations.

Instead, FedEx focused on other merchants and transformed its Ground unit into a low-cost network that delivers everything from toothpaste to toilet paper to U.S. homes and played a crucial role during the pandemic when online shopping soared.

Mr. Smith has been FedEx’s CEO for nearly its whole history. The billionaire was preparing to hand over the reins before the pandemic but extended his stay after two top executives, including his heir apparent, abruptly left, The Wall Street Journal has reported.

The founder had started to take a step back from FedEx more recently, bowing out of some quarterly earnings calls and generally leaving investor questions to his executive team. He has been focusing on policy topics like trade. As executive chairman, Mr. Smith said he plans to focus on corporate governance and on topics like sustainability. After two years of restricted travel, he said he also plans to soon visit employees across the globe.

The FedEx board has been planning for this succession for several months, a person familiar with the matter said, with the board focused on preparing Mr. Subramaniam for a smooth internal transfer of power.

In his letter, Mr. Smith said he had recommended to the board in recent years that if he died or was disabled that Mr. Subramaniam become CEO and the board appoint an independent chairman. He said the board approved the leadership transition at a meeting last week.

One of his sons, Richard, is set to take on a bigger role at the company.

FedEx recently said Richard Smith, who has been with the company in various executive roles since 2005, would lead the Express unit starting in September.

FedEx said it would keep the chief-operating-officer role, which has traditionally been seen as the next in line to CEO, vacant for now.

The company’s shares have fallen about 18% over the past year, compared with a roughly 14% gain in the S&P 500 and a 28% jump in shares of rival United Parcel Service Inc. FedEx’s share price has also lagged behind the market and UPS over the past five years.

FedEx’s financial results have been squeezed in recent quarters as the pandemic boom in package volumes eases and as the company faces higher labor and fuel costs. The company recently reported that it shipped on average 16.8 million parcels a day in the three months ended Feb. 28, compared with 17.6 million in the prior-year quarter.

FedEx executives said that profit margins have been hurt by expanding its delivery network and taking on more customers in recent years—at a time when UPS is culling some of its less profitable customers and pulling back on significant network expansions.

FedEx is holding a meeting for investors in June, when it plans to lay out how it can improve profit margins and discuss its long-term strategy.

Mr. Smith is the latest in a line of company founders or long-serving CEOs who have moved into an executive chairman position instead of stepping aside entirely. They include Amazon founder Jeff Bezos, who stepped aside as CEO to become executive chairman in 2021.

Write to Paul Ziobro at Paul.Ziobro@wsj.com