Facebook relieved investors by forecasting that margins would stop shrinking after 2019 as costs from scandals ease up, sending shares up despite a second-straight quarter with record-low user growth.
Chief Executive Mark Zuckerberg repeated the company's warning that growing user interest in private messaging, video and safer content would cause costs to rise faster than revenue for some time. But he said he was focused on bringing them in line.
That same guidance three months ago sparked Facebook's biggest one-day sell-off as some investors braced for dire results. The third-quarter performance and revised guidance suggested that the downward trend would be more gradual and taper off after 2019, financial analysts said.
Shares of Facebook traded up about 3% after updating its forecast. They reversed course several times, falling and gaining as much as 5%, during an hour of volatility after closing on Tuesday up 2.9% at $146.22.
Facebook, Amazon and Google parent Alphabet had suffered a battering over the last month on Wall Street after leading a years-long rally. Slowing growth has been a top concern, and Facebook's weak results did not squash those fears.

The company estimated revenue growth would slow in the current quarter, compared with last quarter, which could mark the worst performance since its initial public offering in 2012.
The main Facebook service and its Messenger sibling grew monthly users to 2.27 billion, up 10% compared with a year ago but a percentage point below both expectations and last quarter's pace.
Mr Zuckerberg said that Facebook's problem is that users are gravitating toward features such as direct messaging and video viewing faster than it can find ways to place ads there while attracting clicks and not annoying users.
Adding to the challenge is that the bulk of new users are from countries including India, Indonesia and Philippines where advertisers focus more on TV, print and outdoor advertising, Facebook executives said.
Average revenue per US and Canadian user grew 6.7% in third quarter compared with the same period last year. Growth for Asian-Pacific users was 4.6%.              
Total expenses in the third quarter surged to nearly $8 billion, up 53% compared with a year ago. Operating margin, which Facebook has said should fall around 35%, dropped 2 percentage points from last quarter, to 42%.
The company estimated 2018 expenses would rise 50% to 55% above last year, trimming an earlier range of up to 60%. It forecasts expenses will grow 40% to 50% in 2019.
Overall third-quarter revenue was $13.7 billion, up 33% from the same period last year and in line with expectations when accounting for currency fluctuations.
Quarterly profit of $5.1 billion, or $1.76 per share, was up 9% and above the average per-share estimate of $1.48.