Baidu Inc.'s (BIDU) first-quarter net income grew 24% on higher-than-expected revenue, as traffic to the site improved since it launched a new marketing campaign.

Baidu's American Depositary Shares rose 4% to $233.07 in after-hours trading as the company's second-quarter revenue forecast topped analysts' estimates.

The company, which holds a commanding share of the Internet-search market in China, had warned earlier this year that its online marketing customers might scale back on spending. The company was also hit by negative publicity late last year when it was criticized by state media for carrying ads from unlicensed medical companies.

The company spent an additional CNY40 million ($5.85 million) on marketing in the first quarter, including a high-profile television ad campaign over the Chinese New Year holiday in January.

Baidu reported first-quarter net income of CNY181.1 million ($26.5 million), or CNY5.22 (76 cents) per ADS, compared with CNY146.6 million, or CNY4.22 per ADS, a year earlier. Excluding stock-based compensation, earnings rose to 86 cents per ADS from 68 cents. Analysts polled by Thomson Reuters expected 76 cents.

Revenue climbed 41% to CNY810.7 million, or $118.6 million, above the company's February forecast of $114 million-$117 million.

The company said it expects revenue in the second quarter to be between $157 million and $161 million, topping analyst forecasts of $146.5 million, according to Thomson Reuters.

Active online-marketing customers increased 15% to more than 185,000, as revenue per customer grew 22%.

On April 20, Baidu officially launched a new system for its customers to bid for advertising space, called Phoenix Nest. Responding to pressure to more clearly differentiate paid search results, some paid search ads now appear in a shaded area at the top of the screen, in a format similar to that used by arch-rival Google Inc. (GOOG).

On a conference call with analysts, Chief Executive Robin Li said that the initial impact of the advertising changes on revenue would be negative, but he expects the changes to be positive in the long term.

-By Aaron Back, John Kell and Kathy Shwiff, Dow Jones Newswires; (8610) 6588-5848; aaron.back@dowjones.com