iStock

Baidu (BIDU - Get Report)  fell sharply Friday after the Chinese search and internet giant swung to a first-quarter loss.

American depositary receipts of Baidu declined 14.7% to $130.87.

The company posted first-quarter revenue of $3.59 billion, and a net loss attributable to shareholders of $47.5 million. It was Baidu's first loss since it went public in 2005.

Adjusted earnings in the quarter were 41 cents a share.

Analysts were calling for revenue of $3.53 billion and adjusted profit of 40 cents a share.

In a press release, Baidu Chief Financial Officer Herman Yu warned of a difficult environment for its online marketing business.

"Despite government policies to improve the market condition for SMEs, we anticipate online marketing in the near term to face a challenging environment. We will take this opportunity to improve our monetization capabilities and review our businesses for operational efficiency, while recognizing the importance to invest for sustainable long-term growth."

The company also set plans for a $1 billion share buyback program.