The New York Times Company added 139,000 digital-only subscribers in the first quarter of 2018, a 25.5 percent increase from the same period a year ago, helping to fuel total revenue growth and offset a decline in digital advertising.

The company said on Thursday that about 40,000 of the new subscribers came from digital products like the cooking and crossword apps. The gains helped push the company’s total digital-only subscribers to roughly 2.8 million.

The company said total revenue was about $414 million, a 3.8 percent increase from the first quarter of 2017. Subscription revenue increased 7.5 percent to about $260 million, accounting for nearly two-thirds of the company’s total revenue.

“Retention of our core digital news product remains a very encouraging story,” Mark Thompson, the company’s chief executive, said during an earnings call with investors. “We continue to retain the postelection cohorts, some of whom are now well over a year into their subscriptions at least, as well as earlier cohorts.”