NEW YORK — Facebook's stock came within pennies of its $38 IPO price for the first time since its rocky initial public offering more than a year ago.

Shares of Facebook Inc. rose $2.18, or 6.2 percent, to close at $37.61 on Tuesday. The stock hit $37.96 in afternoon trading.

The world's biggest online social network has been on a roll since it reported stronger-than-expected earnings on July 24. Investors are especially upbeat about its fast-growing mobile advertising revenue.

Facebook's ability to grow mobile revenue was one of the biggest concerns in the weeks leading up to its IPO last year. Investors were worried that its ad business was not moving to mobile gadgets as quickly as its user base.

Facebook now derives 41 percent of its ad revenue from mobile advertising.