For the second straight quarter, Baidu (NASDAQ:BIDU) underpromised and overdelivered on its earnings report. While revenue grew 59%, slightly above analysts' estimates, earnings were the real surprise. For the second quarter, Baidu reported 10.09 yuan in earnings per American Depository Share, 23% above analysts' expectations.

Despite two quarters of unexpected earnings growth, Baidu's management is still conservative about the potential for the company to grow profits in the second half of the year. Although mobile search was its biggest revenue and profit driver in the second quarter, Baidu still faces significant competition from companies like Qihoo 360 (NYSE:QIHU). Baidu is also investing heavily in cloud and location-based services as well as international expansion.

Let's take a look at what allowed Baidu to beat earnings expectations last quarter, and whether or not investors should continue to believe Baidu's flat earnings growth story.

Making money on mobile
During a few holidays in the last quarter, Baidu saw mobile traffic exceed PC traffic on its search engine. Management said at the beginning of the year that it expects mobile traffic to exceed PC traffic at some point this year, and it looks like it's near the tipping point. Last month, Mobile Baidu had over 500 million active users.

Mobile CPC, or cost per click, for advertisements is still below PC ad prices, but the gap is narrowing. With the faster growth in mobile users and ad prices, mobile revenue climbed above 30% of Baidu's total revenue.

Mobile growth didn't come without significant spending increases, however. SG&A expenses nearly doubled year over year, with the biggest increase coming from promotional spending for mobile products. Traffic acquisition costs also grew significantly -- 72.4% -- and this was partially attributed to mobile.

Baidu is spending heavily on mobile because its competition -- Qihoo 360 -- has one of the strongest presences on mobile devices in the world. The company's security software is ubiquitous, installed on 538 million devices as of the end of the first quarter.

Qihoo has capitalized on its mobile presence with a popular app store and mobile browser. Most recently, the company launched a competing search app. We'll get more information on Qihoo's mobile search progress in its earnings report next month, but the company has already taken 25% of the total search market in just two years.

Will spending outpace revenue in the second half?
Baidu plans to spend a lot of money in the second half of 2014. In fact, CFO Jennifer Li basically said it's going spend as much as it needs in order to reach its strategic goals in mobile search, location-based services, and international growth in countries like Brazil. There is no margin target.

In the second quarter, operating margin declined to 29.6% from 38.4% in the year-ago period. Still, revenue growth was so strong that it translated into a 22.5% growth in operating profit year over year.

With analysts expecting just 2.5% earnings growth for the third quarter, they certainly expect Baidu's spending to catch up with its profit growth. It's reasonable to expect that those estimates will climb somewhat over the next few weeks, though, especially after Baidu's most recent report.

Management expects revenue to grow 50.9% to 55% year over year this quarter, above analysts' expectations. Mobile will once again be the biggest driver as traffic continues to climb and mobile ad prices close the gap with PC ads.

Although the company just launched its Portuguese-language search engine in Brazil, it's not expected to generate significant revenue short term. There's already well-established, big-name competition in the market, but Baidu will spend heavily to establish its presence there.

Throw your profit expectations out the window
When it comes to Baidu's profit growth, investors might as well expect the unexpected. Baidu is focused on growing revenue, and it's doing an excellent job so far. Profits will come sooner or later.

Baidu's focus on the mobile market is key going forward for a couple of reasons. First, mobile traffic is bound to outgrow PC traffic in China, where smartphones are increasingly the primary way of accessing the Internet. Second, mobile revenue per user has the potential to eventually outgrow PC revenue with location-based services (another area of focus) and improved CPC for ads.

Baidu still has work to do to fend off the competition and dominate the space like it's done with the PC for years. It's done extremely well so far, however, and is rewarding shareholders for believing in management's growth plan.

Adam Levy has no position in any stocks mentioned. The Motley Fool recommends Baidu. The Motley Fool owns shares of Baidu. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.