SAN FRANCISCO — The fine levied against Google by the European Union walloped parent company Alphabet's second-quarter profit, which dropped 28%, even as the Internet giant continued to post impressive gains in its lucrative advertising business.

Net income fell to $3.52 billion, or $5.01 a share, from $4.88 billion, or $7 a share, in the year ago quarter. Excluding certain items such as the EU fine, earnings were $8.90 a share.

Shares fell 3% after hours to $966.

Google's advertising business continued its rapid growth in the second quarter powered by mobile search and YouTube.

Alphabet topped Wall Street estimates with earnings per share and revenue of $26.01 billion, up 21%. Excluding advertising commissions, Alphabet had revenue of $20.92 billon, slightly ahead of analysts' expectations.

The talk of Google executives is its cloud computing business, sales of which they are betting can one day overtake Google's advertising business. The "other revenue" segment that includes Google’s cloud sales grew by 42% to $3.09 billion in the second quarter.

This is crucial for Google, whose digital advertising business will eventually reach a point of saturation, analysts say.

"We have been making big bets within Google focused on cloud, hardware and subscription businesses in YouTube, in order to better serve customers while also building additional and differentiated revenue streams," Alphabet chief financial officer Ruth Porat told analysts during a conference call.

Despite "stellar revenue growth," Pivotal Research Group analyst Brian Wieser says he's worried about lower margins.

"Our longer-term expectations are reduced slightly, and we now value shares at $940 versus $980 previously," said Wieser, who rates the stock "hold."

Profit plunged because Alphabet took a charge in the quarter for the $2.74 billion antitrust fine from European regulators. The fine came after a seven-year investigation that found that Google favored its own shopping ads in search results.

Google denies the charges and is considering an appeal, but a ruling from the European Court of Justice could take years.

It's unclear how Google will resolve the European Union's objections. Google could face new fines if it does not change how it displays shopping results in search by September.

Porat says Google is reviewing its options.

"We are still early in our analysis of the decision and the right next steps," Porat said during a conference call with analysts. "We have time to notify the commission of proposed remedies as well as to implement changes."

Further creating uncertainty for Google: More fines could be coming. There are antitrust probes underway in Europe into Google's advertising business and its mobile operating system Android.

"There is significant uncertainty as to the outcomes of these investigations; however, adverse decisions could result in fines and directives to alter or terminate certain conduct. Given the nature of these cases, we are unable to estimate the reasonably possible loss or ranges of loss, if any," Alphabet said in a regulatory filing.

"Changes to the company’s practices — left ambiguously for Google to solve, or else face another fine — may hurt revenue growth," Wieser said.

"Other investigations (including separate ones focused on AdWords and Android) could lead to more fines and changes to business practices which could further reduce growth. We don’t see the EC letting up any time soon," he wrote in a research note.

Alphabet, whose shares are up 26% this year, reported earnings after the market closed on Monday.