SUNNYVALE — Beleaguered internet giant Yahoo will be sold to Verizon in June, Yahoo CEO Marissa Mayer said Tuesday as the company’s quarterly financial results beat Wall Street’s expectations.

“With the transaction anticipated to complete in June, I’ve never been more proud of the improvements we’ve made to the business and the value we’ve delivered to our shareholders,” Mayer said in a statement. “As we enter our final quarter as an independent company, we are committed to finishing strong and planning for the best possible integration with Verizon.”

The $4.5 billion sale was initially scheduled to close in the first quarter of this year, but news of Yahoo’s two huge breaches of users’ data pushed it back.

That delay means Google and Facebook have been eating Verizon’s digital-advertising lunch, said Pivotal Research analyst Brian Wieser.

“They are taking the bulk of the growth in the industry,” Wieser said. “The industry is evolving and Verizon kind of has to wait to get this deal done. I’m sure they’re making a lot of other plans. But they can’t really execute.”

For the first quarter of 2017, Yahoo boosted its year-over-year performance, bringing in $1.3 billion in revenue, exchanging a $99 million loss for a $99 million profit, and beating Wall Street’s expectations.

On top of the 22 percent revenue increase from the same period last year, earnings per share hit 10 cents, beating analysts’ expectation of 5 cents per share. Analysts also had predicted first-quarter revenue of $1.23 billion.

Revenue from mobile jumped dramatically, with Yahoo bringing in $412 million this past quarter, compared to $260 million in 2016’s first quarter.

For Verizon, Yahoo’s quarterly numbers confirm that “there is still a scaled digital business,” Wieser said.

“It’s not falling apart for the most part. That’s good.”

Yahoo’s sale process to Verizon was beset by shattering revelations last year that the company had suffered the two largest hacks of users’ personal information in history, and had known about one of them nearly two years before making it public. Those troubles have generated at least two dozen lawsuits and gave Verizon leverage to knock $350 million off the sale price, which had originally been set at $4.83 billion.

The sale will mean Yahoo’s current holdings in Chinese e-commerce giant Alibaba and Yahoo Japan, along with a patent portfolio, will become assets of an investment company called Altaba. Yahoo as a brand will be preserved within Verizon, merged with Verizon’s AOL into a company called Oath.

Mayer has been widely vilified for failing to turn around the struggling firm. In March, the firm’s board stripped her of $12 million in compensation. If terminated without cause or if she leaves for “good reason” of her own after close of the Verizon sale, she will receive a $23 million golden parachute, according to a Yahoo regulatory filing.

While there’s been no official confirmation that Mayer will leave Yahoo, another filing stated that she would not serve on the board of Altaba, and many analysts have said she’s unlikely to be kept on at Verizon.