Twitter is finally in the black.
The company said Thursday it posted a modest $91 million profit in the final three months of 2017, marking the first time the company has had a profitable quarter since going public in 2013.
Twitter says it expects to be profitable for all of 2018 as well.
It's a hard won milestone for Twitter. The company has gone through multiple rounds of layoffs since cofounder Jack Dorsey returned as CEO in 2015. And it has cut beloved but pricey projects like Vine, a video sharing service.
Twitter also received a boost from a surprise rebound in its advertising business. The company posted sales of $732 million for the quarter, up 2% from the same period a year earlier, reversing a sales decline that has plagued the company in recent quarters.
In a letter to shareholders, Twitter chalked up the sales boost to "better-than-expected growth" in ad sales "across all major products and geographies."
The stock jumped 18% in pre-market trading Thursday following the earnings report.
While the sales rebound and profitability milestone offer hope that Twitter's turnaround efforts are bearing fruit, the social media company continues to face significant challenges.
Twitter's user growth remains stagnant. It had 330 million monthly active users for the quarter, effectively failing to grow its audience at all.
Last month, Twitter's COO Anthony Noto announced plans to leave the company to take over as CEO of a startup. Noto had previously served as Twitter's CFO and was arguably the most important executive at the company other than Dorsey.
Twitter has said Noto's responsibilities will be handled by various members of its leadership team. Dorsey continues to be a part-time CEO, running both Twitter and Square.