Google's core advertising business helped to propel a 22% increase in sales during the second quarter, even while the cost of its ads dropped.

Revenue for the quarter ended June 30 was $15.96 billion, Google said yesterday, beating the forecast of $15.62 billion, from analysts polled by Thomson Reuters.

Net income was $3.42 billion, up nearly 6% from $3.23 billion in the second quarter of 2013.

The company's earnings per share, excluding certain expenses, was $6.08, a disappointment to analysts expecting $6.24 in earnings.

Thursday's results marked the first time Google separated out the money it makes from ads placed on its own sites like and YouTube, versus the ads on outside sites.

The numbers showed the paid clicks on Google's own sites rose by 33%, suggesting a strong core business. Paid clicks on outside sites rose by roughly 9%.

But the cost per click dropped by roughly 7% on Google's sites. The cost dropped by 13% on outside sites. The drop could be due to the lower price of ads on mobile devices.

Still, "Google had a great quarter," CFO Patrick Pichette said.

Google is working hard on specialized software for mobile devices such as its Google Now digital assistant. Last month during the Google I/O developer conference, Google announced a number of new projects to get Google's Android mobile operating system on more devices, including watches and in-car displays.

During a conference call about the results, Google admitted it has some problems monetising its services on smaller screens, at least for now.

"Right now, mobile does not monetise as well as certain other forms," said Nikesh Arora, Google's chief business officer. "But given the huge influx of queries we're seeing, we expect as it's made more relevant to find information, in the long term, mobile should monetise even better than the desktop," he said.

Google still dominates the market for digital advertising, this year taking in more than 31% of all spending on digital advertising worldwide, according to the research group eMarketer.

Google will lose about half a percentage point of market share this year, eMarketer predicted in a recent report. That will primarily be due to the growing success of its competitors, eMarketer said.

Facebook is doing well in mobile, with nearly 60% of its sales made there, the company reported in its first-quarter earnings report in April. Google does not break out the percentage of its sales derived from mobile.

Google also said that Arora would be leaving the company after 10 years with Google. He will be replaced for now by Omid Kordestani, Google's business founder, the company said.

Google shares were trading up after hours Thursday at $582.33, after closing at $573.73.