Google Inc posted a 23 percent gain in first-quarter revenue, beating analysts' average estimate but only slightly exceeding the most bullish expectations on Wall Street.

Shares of Google, which have risen roughly 5 percent since Monday, slid 3.1 percent to $576.92 in after-hours trade on Thursday. They had gained 1.1 percent during the regular session on Nasdaq.

They've had a strong last few days with the shares up 5 percent, and some investors expected Google to beat by a wider margin and price-per-click to come in a bit higher than 7 percent growth, said Edward Jones analyst Andrew Miedler.

Google also said it increased its headcount by nearly 800 employees -- the biggest increase in staff since the first quarter of 2008.

Google -- which has beaten earnings expectations in every quarter but one in the past two years -- posted net income of $1.96 billion, or $6.06 a share, up from $1.42 billion, or $4.49 a share, in the year-earlier period.

Excluding certain items, Google said it earned $6.76 a share, beating the $6.60 average forecast by analysts polled by Thomson Reuters I/B/E/S., which collects earnings expectations from professional and individual investors, said the outlook for Google's earnings per share was $6.74.

The Mountain View, California-based company, which controls roughly two-thirds of the U.S. search market, said revenue in the first quarter totaled $6.77 billion, compared with $5.51 billion in the year-ago period.

Net revenue, which excludes costs that Google pays to partner Websites, was $5.06 billion, up 2.2 percent from the seasonally strong fourth quarter and above analysts' average estimate of $4.95 billion.

(Reporting by Alexei Oreskovic; Editing by Richard Chang)