SAN FRANCISCO – Facebook Inc. has just one question for Wall Street: How do you like me now?

Shares of the social network, which had fallen from favor after its disastrous public debut last year, hit new highs this week, even as U.S. stocks have slumped.

In recent weeks, Facebook shares have zipped past the initial public offering price of $38. Now they are flirting with $50 after another in a wave of buy recommendations from analysts and a report that the company may finally have gotten its foot in the door in China.

With nearly 1.2 billion users, Facebook has begun to prove that its ads on smartphones and tablets are effective, analysts say. And investors are betting Facebook can wring even more money from ads on mobile devices.

They are also feeling optimistic about potential new sources of revenue such as video ads and ads on Facebook’s photo-sharing service Instagram, expected to launch in coming months.

Facebook shares, which have more than doubled in the past 52 weeks, rose $1.01, or 2.1 percent, to $49.46 on Wednesday. Shares had hit an all-time high of $49.66 during Tuesday trading.

Facebook has seen a torrent of analysts upgrading their recommendations since posting big gains on higher revenue from mobile ads.

After staging the largest technology IPO on record, the stock lost more than half its value last year, falling as low as $17.55. It did not reach $38 again until last month.

Citigroup’s Mark May is the latest analyst to rethink prospects for Facebook after its surprisingly strong results in July.

May upgraded his rating to “buy” from “neutral” on Tuesday, saying he expects more growth from Facebook, especially in mobile advertising revenue. He raised his price target to $55 from $32. Among the highlights of the report: May expects Facebook shares to be added to the Standard & Poor’s 500 index by year’s end. That could prompt more fund managers who track the index to buy the stock.

In another boost for Facebook, websites banned in China may be accessible in a free-trade zone that is being set up in Shanghai, according to a report in the South China Morning Post.

China’s first free-trade zone will allow the access in a rare exception to strict government control of the Internet, the Hong Kong newspaper reported.

The report, citing unnamed government sources, said authorities would also welcome bids from foreign telecommunications firms for licenses to offer Internet services in the trade zone, which was established in July.

China’s Community Party censors the Internet. Facebook and Twitter were blocked by Beijing in 2009 after deadly riots in the western province of Xinjiang.