Facebook stock closed way up Wednesday as optimistic investors reacted to Facebook’s better-than-expected earnings report.

After spending a lot of time below $20, Facebook stock closed nearly 20 percent up at a share price of $23.23 on news that the company was making more money than expected off mobile advertising. The company posted a net loss of $59 million on $1.26 billion in revenue.

As The New York Times reported, Wednesday’s trading spike gave Facebook the biggest single-day gain since the social network went public in May.

Arvind Bhatia, an analyst at Sterne Agee, said in a note to investors that the company’s mobile advertising rates far outstripped expectations.

“We feel this was the single biggest take-away from 3Q earnings,” Bhatia said. He pointed out that the company's recent partnership with Apple to integrate the social network into the mobile iOS operating system had dramatically increased engagement on the mobile platform.

Other analysts said they were cautiously optimistic about Facebook’s plan moving forward. The numbers indicate that the company is taking the shift to mobile seriously and is seeing some success making money off its more than 1 billion users around the world.

Several analysts upgraded Facebook’s stock, adding to the company’s upward momentum on the market Wednesday. As The Wall Street Journal reported, Citigroup, Stifel Nicolaus and Bank of America all boosted their ratings to a “buy” from previous "neutral” or “hold” positions.

Through Tuesday’s close, The Wall Street Journal noted, the company’s stock had fallen 48 percent from its debut price of $38 per share.

(Washington Post Co. Chairman and Chief Executive Don Graham is a member of Facebook’s board of directors.)

Related stories:

AP: Facebook’s stock soars after 3Q results show mobile gains, ad revenue growth acceleration

Zynga reports third-quarter earnings

On Leadership: Is Mark Zuckerberg right to stay on as Facebook CEO?