Amid fears of a significant decline in revenue growth, Snap Inc. stock surged as much as 10% before falling roughly 5% in the extended session Tuesday, after the company issued quarterly guidance for the first time as well as reported a user decline.

Snap stock ended after-hours trading up 0.6% and was flat in premarket trade Wednesday.

At the high end Snap’s revenue guidance, it met Wall Street’s expectations for the upcoming third quarter, unlike its social-media rivals Twitter Inc. TWTR, -4.83% and Facebook Inc. FB, +0.20% , which were pummeled by investors after reporting soft or flat user growth and offering guidance that gave investors cause for concern. But Snap also reported that its global daily user base declined compared with the first quarter, even as the company squeezed more revenue from each user.

Snap SNAP, -4.13% executives said in its second-quarter earnings call Tuesday that the decline in user numbers was related to the company’s ill-fated redesign efforts, but would not offer guidance for the second half of the year. Chief Financial Officer Tim Stone noted its third-quarter user growth has historically slowed compared with the second quarter.

The Los Angeles-based company expects third-quarter sales of $265 million to $290 million, which at the top end slightly beats Wall Street’s estimate of $289 million. When asked about the revenue forecast in the earnings call, Stone pointed to the company’s lower ad prices as a result of its change to its self-serving technology, among other factors.

“These were not mixed results on the financial side,” said Forrester analyst Melissa Parrish. “Every important number on the financial side appeared to be increasing. And that average revenue per user was increasing, which means it can support higher ad loads. The other reason average user revenue could be increasing is that they are commanding higher prices. It shows the programmatic efforts are paying off.”

See also: Facebook copied Snapchat, and it is hurting profit

The vast majority of the money Snap makes is from ad sales within its Snapchat app, a business that brought in the vast majority of the company’s $262.3 million in second-quarter sales, with its North American region adding $177.4 million to the top line and Europe accounting for $40.2 million. Analysts had expected sales of $249.5 million.

Snap said on its earnings call that the company had now moved all of its ad products to its programmatic or self-serve platform. Prior to doing so, the company had relied on a more cumbersome, manual process of initiating an ad-buying order. Despite the move to a programmatic platform, Stone said 25% of ad revenue remained outside its self-serve channels during the second quarter.

The downside of moving to programmatic buying is sliding ad-inventory prices, but in the long run it lets Snap capture the long tail of small and midsize businesses, which have powered success for Facebook and Alphabet’s GOOGL, +0.95% GOOG, +0.92% Google.

“Snap’s strong Q2 performance is evidence that consumers and advertisers continue to depend on the platform for engaging, ephemeral content,” said Aaron Goldman, the chief marketing officer of 4C, an advertising technology company. Goldman said 4C saw a 45% increase in spending on Snap ads compared with the year-earlier period.

But even as Snap made improvements to its ad business, it continued to bleed red ink. The company logged net losses of $353.3 million in the quarter, which amounts to 27 cents a share, narrowing from losses of 36 cents a share in the year-earlier period.

See also: Amazon is becoming an advertising giant

The newest version of its Spectacles camera-glasses launched during the quarter, but the company did not break out or discuss sales of the hardware.

A key indicator of the company’s health is its user base, which Snap reports as daily active users. That number gained 8% over the same quarter last year, but shrank 2% from its first-quarter daily user count, to 188 million — though it also indicated there was a slight increase in growth for users over 35, an age bracket that has been difficult for the company to grow. Executives also said that some of the daily users it lost continue to log in every month, a data point Snap did not previously disclose to investors. It now says it has 100 million monthly users in North America.

Each user continues to be worth more to Snap, and the average revenue per member rose 34%, compared with the year-earlier quarter, to $1.40. North America is Snap’s most valuable market, with average user revenue of $2.21.

Don’t miss: Snap’s first ‘shareholder meeting’ disappeared almost as soon as it began

After the closing bell Tuesday, Prince Alwaleed bin Talal of Saudi Arabia said that he has a roughly $250 million stake in Snap, or 2.3% of its class A stock. The prince met Snap’s chief executive in 2015 on a trip to Riyadh, Saudia Arabia.

“Snapchat is one of the most innovative social media platforms in the world and we believe it has only just begun to scratch the surface of its true potential and we are blessed to be part of it,” the prince said.