(Reuters) - Snapchat owner Snap Inc on Tuesday reported surging growth in users and revenue in its latest quarter, reviving hopes that it can survive competition with Facebook Inc’s Instagram and sending its shares up more than 20 percent.

Investor enthusiasm for the instant messaging application company faded after its initial public offering last year.

But the Venice, California-based firm said that customers were now staying longer on the Android version of its app, after software bugs were fixed, and advertisers were taking to an auction-based advertising system that made it cheaper and easier to buy ads.

Snapchat’s daily active users rose to 187 million in the quarter that ended Dec. 31 from 178 million in the third quarter, beating analysts’ average expectation of 184.2 million users, according to financial data and analytics firm FactSet.

Daily active users rose 18 percent from a year earlier, reversing a trend of slowing growth. The figure is closely watched by investors who hope user growth can be translated into advertising revenue.

Revenue rose 72 percent to $285.7 million, beating analysts’ expectations of $253.2 million as companies advertised more in the key holiday quarter.

Instagram, with more than twice the daily users of Snapchat and backed by Facebook’s large bank account, has threatened to stamp out its rival by copying features such as photo filters and disappearing slide shows.

Confidence that the two could coexist in the social media sector was shaken when Snapchat’s user growth stalled last year. Analysts, though, said that Snapchat appeared willing to look inward and try to fix problems rather than be distracted by Instagram.

“They are going to continue to be competitors, and Snap is doing a creditable job of competing for revenue,” analyst Michael Pachter of Wedbush Securities said.

FILE PHOTO: The Snapchat messaging application is seen on a phone screen August 3, 2017. REUTERS/Thomas White/File Photo

Snapchat is courting advertisers in an internet ad market dominated by Facebook and Alphabet Inc’s Google, which together control half the market share, according to research firm eMarketer.

While Snapchat ads once were primarily bought by large brands with household names, revenue from smaller businesses more than doubled from the third quarter to the fourth, Chief Strategy Officer Imran Khan said on a conference call.

“We know that in order to truly scale our business, advertising on Snapchat has to be really easy,” Khan said.

Ad prices have fallen as Snapchat lets advertisers use self-serve software to buy, but the number of ad impressions was up more than 575 percent from a year earlier in the fourth quarter, Chief Financial Officer Drew Vollero said.

Vollero said more than 90 percent of ads were sold on Snapchat’s auction, which is capable of handling larger volume than a human sales staff, and the company tripled the number of advertisers buying there.

Shares traded at $17.09 after the bell, up 22 percent, and had traded even higher.

Amid concerns Snapchat would not be able to keep growing rapidly in the face of Instagram’s competition, Snap’s stock price had fallen by half from its $29.44 high after its initial public offering last year and not traded above the IPO price of $17 since July 10. Snap had not reported upbeat results since going public.

In addition to fixing bugs, the company is redesigning Snapchat to make it easier to use. Chief Executive Evan Spiegel said the new version had rolled out to 40 million users and would launch worldwide in the first quarter.

Acknowledging a perception that Snapchat is popular mainly among millennials, Spiegel said: “We believe that the redesign has also made our application simpler and easier to use, especially for older users.”

Snap posted a net loss of $350 million, or 28 cents per share, compared to a loss of $170 million, or 20 cents per share, a year earlier.

Excluding items, Snap reported a loss of 13 cents. Analysts on average expected a loss of 16 cents per share, according to Thomson Reuters I/B/E/S.

Revenue per user rose 46 percent from a year earlier to $1.53, while cost of revenue per user rose 5 percent to $1.02.

Still, the company expects its year-over-year revenue growth rate to moderate in the current quarter compared with the fourth quarter, Vollero said.