Shares in Alphabet, Google’s parent company, jumped as much as 5% in after-hours trading after the firm reported stronger ad sales than expected.
Alphabet earned $32.7bn in revenue in the three months to the end of June, up 26% from the same period last year.
But the record €4.34bn EU fine over over Google’s Android mobile operating system knocked $5bn off its profits.
Alphabet reported net income of $3.2bn. Without the fine, it would have been almost $8.3bn, the firm said.
The EU said Google had used the mobile operating system to illegally “cement its dominant position” in search.
Alphabet is appealing the decision, which drove a 36% increase in costs in the quarter.
On a call with financial analysts, chief executive Sundar Pichai said it was too early to say how the changes requested by regulators would affect the firm’s business over the long term.
“There is more work to be done and I think it will become clearer as we go along,” he said.
Mr Pichai also said it was too early to say what effect Europe’s new privacy law – the General Data Protection Regulation (GDPR) – is having.
Dave Lee, BBC North America technology reporter, San Francisco
On the face of it, the European Commission’s massive fine hasn’t really hurt Alphabet – at least not in the eyes of investors.
But it’s important to remember that simply paying the fine – if Google loses its appeal – doesn’t make the problem go away.
The European Commission has demanded big changes to the Android platform, changes that once implemented could impact Google’s huge gains in search revenues.
The strong performance in this part of the business is what’s keeping investors happy despite the fine – but those smiles might crack once the full extent of Europe’s ruling is understood.
The fine is just the beginning – it’s the changes to Google’s vast mobile empire that could cause real harm to the business model.
“I’m confident that we can find a way to make sure Android is available at scale to users everywhere,” Google’s chief executive, Sundar Pichai, told investors.
It may be his biggest challenge yet.
Digital ad market
Alphabet, which relies on advertising for the bulk of its business, is facing an increasingly competitive market, as firms such as Amazon make inroads.
In March, the research firm eMarketer estimated that Google would capture about 37% of digital ad spending in the US this year, down from almost 39% in 2017.
Despite the competition, Alphabet said pressure from traffic acquisition costs, which reflect what it pays other companies to drive users to its sites, had lessened.
As a share of ad revenue, those costs fell from 23% to 22%.
Alphabet has also branched out into a range of other areas, including cloud computing, YouTube and driverless cars.
The firm said cloud computing and YouTube are enjoying growth.
Its Other Bets segment, which includes companies like the driverless car firm Waymo, reported a quarterly operating loss of $732m, up from $633m last year.