Twitter posted a net loss Tuesday due mostly to a lawsuit settlement, but its revenue rose sharply in the third quarter, boosted by solid ad sales around the globe.

The San Francisco-based company said Tuesday that its net loss was $536.8 million, or 67 cents per share, in the July-September quarter. That’s down from a profit of $28.7 million, or 4 cents per share, in the same period a year earlier.

The loss included a one-time net charge of $766 million from a shareholder lawsuit the company settled. Twitter said last month that it will pay $809.5 million to settle a consolidated class action lawsuit alleging that the company misled investors about how much its user base was growing and how much users interacted with its platform.

Revenue rose 37% to $1.28 billion from $936.2 million.

Analysts, on average, were expecting revenue of $1.29 billion, according to a poll by FactSet.

One big source of worry for investors has been Apple’s iOS privacy changes, which dinged rival Snap’s quarterly results announced earlier this month. Twitter said while it’s still too early to assess the effects of the changes, the impact on the quarter’s revenue was “lower than expected.”

Twitter said it had 211 million daily active users, on average, in the third quarter, up 13% from a year earlier. Analysts were expecting 211.5 million.

Shares of Twitter rose $1.29, or 2.1%, to $62.72 in after-hours trading.