SAN FRANCISCO — Verizon has taken over Yahoo, completing a US$4.5 billion deal that will usher in a new management team to attempt to wring more advertising revenue from one of the Internet’s best-known brands.

Tuesday’s closure of the sale ends Yahoo’s 21-year history as a publicly traded company. It also ends the nearly five-year reign of Yahoo CEO Marissa Mayer, who isn’t joining Verizon. She will walk away from Yahoo with a compensation package currently worth about $125 million, including her severance pay and stock awards that will be fully vested with the deal’s completion.

Yahoo’s email and other digital services such as sports, finance and news will be run by Tim Armstrong, who has been running AOL since Verizon bought that company for $4.4 billion two years ago. Armstrong will now be CEO of a new Verizon subsidiary called Oath, which will consist of Yahoo and various AOL services.

About 2,000 Yahoo and AOL workers are expected to lose their jobs as Verizon trims expenses and eliminates overlapping positions.

“Now that the deal is closed, we are excited to set our focus on being the best company for consumer media, and the best partner to our advertising, content and publisher partners,” Armstrong said.

Verizon won’t be getting Yahoo’s prized stakes in two Asian internet companies, Alibaba Group and Yahoo Japan. Those will belong to a newly formed company called Altaba, which also will inherit Yahoo’s $8 billion in cash and any money that might have to be paid in various shareholder lawsuits filed against Yahoo leading up to the sale.

The suits include complaints tied to computer hacking attacks that stole personal information from more than 1 billion Yahoo user accounts in 2013 and 2014 but weren’t disclosed until last year. The fallout from the digital intrusions forced Yahoo to give Verizon a $350 million discount on the initial sale terms reached last July, causing the deal to be delayed by several months.

Altaba’s stock will begin trading next week under the ticker symbol “AABA.” Yahoo’s stock will trade through Friday.

Verizon is counting on the combination of Yahoo and AOL to build a strong third alternative in a rapidly growing digital advertising market that is currently dominated by Google and Facebook.

But Yahoo’s ad revenue has been falling for most of the last decade. The company lured Mayer away from Google in 2012 in hopes of reversing the decline, but she couldn’t pull it off despite investing billions in acquisitions aimed at making Yahoo a bigger player in the mobile advertising market.

By the end of last year, Yahoo’s annual revenue after subtracting ad commissions had shrunk to $3.5 billion, a 35% drop from its 2008 peak. By comparison, Google’s revenue last year totalled $73 billion, after subtracting ad commissions.

Despite the company’s struggles, Yahoo’s stock more than tripled while Mayer was CEO, creating more than $30 billion in shareholder wealth.

But most of those gains stemmed from Yahoo’s stake in Alibaba, a Chinese e-commerce company whose fortunes have soared while Yahoo faded. The Alibaba investment was engineered 12 years ago by Yahoo co-founder Jerry Yang in what is now widely regarded as one of the savviest deals in internet history.