Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

AT&T CEO Randall Stephenson is stepping down from the company, just days after the telecom operator reported it lost 3.42 million video subscribers in 2019. Stephenson announced his departure at the annual meeting held Friday.

Stephenson is being replaced by the company’s president and chief operating officer, John Stankey, who had also been running WarnerMedia, which owns big assets including CNN, HBO and Turner.

Stephenson will become executive chairman of the board of directors until January 2021, according to a statement. He had been chief executive for 13 years.

President Donald Trump, once friendly with Stephenson, wasted no time jabbing him over his departure. AT&T’s ownership of CNN has been problematic for Trump, given his intense dislike of its coverage of the White House. AT&T was notably absent from the list of companies named on the president’s business task force, which included Verizon and a number of other telecom providers.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Great News!" Trump tweeted on Friday morning. "Randall Stephenson, the CEO of heavily indebted AT&T, which owns and presides over Fake News @CNN, is leaving, or was forced out. Anyone who lets a garbage “network” do and say the things that CNN does, should leave ASAP. Hopefully replacement will be much better!"

Great News! Randall Stephenson, the CEO of heavily indebted AT&T, which owns and presides over Fake News @CNN, is leaving, or was forced out. Anyone who lets a garbage “network” do and say the things that CNN does, should leave ASAP. Hopefully replacement will be much better! — Donald J. Trump (@realDonaldTrump) April 24, 2020

The timing means AT&T will have a new leader at one of the most challenging times in economic history. With unemployment at a record high, consumers are struggling to pay for internet and phone connections.

The company is also making a multibillion dollar bet on the transformation of video consumption, launching a costly streaming venture, HBO Max, which launches May 27.

“I’m honored to be elected the next CEO of AT&T, a company with a rich history and a bright future,” Stankey said in a press release. “My thanks go to Randall for his vision and outstanding leadership during a period of tremendous change and investment in the core capabilities needed to position AT&T well for the years ahead."

Stephenson is the second major chief executive to step down as the coronavirus pandemic continues to take an economic toll. Disney chief executive Bob Iger also said he was stepping down, but maintains an ongoing operational role at the company.

“Randall leaves behind a transformed AT&T. But the jury is still out as to whether that transformation has been for the good. The choice of John Stankey speaks to a clear endorsement of the status quo," telecom analyst Craig Moffett of independent equity research firm Moffett Nathanson told NBC News.

Stephenson’s troubles with the Trump White House extended to the Department of Justice, which blocked AT&T’s plan to acquire Time Warner. AT&T eventually won, but the prolonged court action cost the company both financially and in terms of slowing the merger.

Heading into the pandemic, AT&T was already struggling with a large debt load and there have been questions about how it will continue to pay shareholders a dividend. The company ended the last quarter with $147.2 billion in long-term debt.

Stephenson had been under pressure to name a successor after the telecom operator was targeted by activist investor Elliott Management, who wanted stronger results from the company’s acquisition of Time Warner, now renamed WarnerMedia. It reached a truce with the investor after coming up with a three-year plan to sell assets.