SAN FRANCISCO — Snap lost millions of users last year after an unpopular redesign of Snapchat, its ephemeral-messaging app. Now that exodus appears to be slowing.

The company said on Tuesday that it had stanched the flow of people leaving its platform. Snap’s daily active users totaled 186 million in the fourth quarter, the same as in the previous quarter and down just one million compared with a year earlier, after two consecutive quarters of falling user numbers. In addition, Snap’s revenue rose 36 percent to $390 million, while its net loss narrowed to $192 million.

“Change is always difficult, and this past year was no exception,” Evan Spiegel, Snap’s chief executive, said in prepared remarks about the company’s earnings.

The financial report, which sent Snap’s shares soaring more than 20 percent in after-hours trading, follows months of turbulence for the company. Since going public in 2017, Snap has been dealing with increasing competition from Facebook, including its core social network and its other apps, such as Instagram and WhatsApp.