Snap shares surged more than 12% in after-hours trading on Tuesday after the app developer reported quarterly results that soared past analysts' estimates.

The company, which is the maker of Snapchat, posted a slimmer-than-expected loss for the second quarter while exceeding expectations for user growth and revenue.

Loss per share: 6 cents vs. 10 cents forecast by Refinitiv

6 cents vs. 10 cents forecast by Refinitiv Revenue: $388 million vs. $359.7 million forecast by Refinitiv

$388 million vs. $359.7 million forecast by Refinitiv Global daily active users (DAUs): 203 million vs. 192.4 million forecast by FactSet

203 million vs. 192.4 million forecast by FactSet ARPU: $1.91 vs. 1.84 forecast by Refinitiv

"The growth in our community, engagement, and revenue is the result of several transitions we completed over the past 18 months," said Snap CEO Evan Spiegel in a statement. "We look forward to building on our momentum and making significant ongoing progress in each of these areas."

Snap's user base grew to 203 million daily active users. This was the second quarter in a row of growth for the company, which saw its user base shrink from 191 million daily users in the first quarter of 2018 to 188 million the following quarter.

The company reported revenue of $388 million for the second quarter, up 48% compared to a year prior. Notably, the company reported a gross margin of 46%, a vast increase from the 30% gross margin reported a year prior.

"We continue to make significant progress in driving down our underlying unit costs over time, including the cost to deliver a Snap, the cost to deliver an impression, and other key drivers of infrastructure costs," said Snap Chief Financial Officer Derek Andersen in his prepared remarks.

After a rough 2018, Snap has bounced back in 2019. Its shares have rocketed more than 180% since hitting a record low of $4.99 on Dec. 21.