NEW YORK (AP) -- The publisher of The New York Times posted a 20% gain in fourth-quarter profits as the paper continued to add digital subscribers, although ad revenue declined both online and in print.

In 2019, the Times set a goal of 10 million subscribers by 2025, and hit the halfway mark in the latest quarter with 5.3 million print and digital subscribers. It sells access to its newspaper as well as separate subscriptions for its crosswords and recipes. In the fourth quarter, it added 342,000 new digital subscriptions. It added more than 1 million in 2019.

The company is transitioning from its roots in print to a more sustainable online model for news; many local outlets and other newspaper chains have struggled with similar efforts.

The Times is raising the price of its digital-only news subscription to $17 a month from $15 for many customers, the first such increase since it launched in 2011. It will affect 750,000 customers by the end of the year.

Subscription revenue in the fourth quarter rose 4.5% to $275.3 million, while advertising revenues declined 10.7% to $171.3 million.

Print-ad revenue slid 10.5% to $79.1 million, while digital-ad revenue fell 10.8% to $92.2 million. Print-ad sales have long been falling as readers shift online. The company did not offer an explanation for the digital decline other than to say that it was a difficult comparison to a strong 2018 quarter. The company expects digital advertising revenue to continue to drop this quarter.

It also got a big revenue bump from its TV show, "The Weekly," which launched last summer, as well as its growing podcast business.

The New York Times Co. reported that overall fourth-quarter earnings rose 20% to $68.2 million, or 41 cents per share, while revenue rose 1% to $508.4 million.

For the year, the New York-based company reported profit of $140 million on revenue of $1.81 billion.

The company's stock rose 13.5% to $38.83 in afternoon trading. Shares of The New York Times have risen 27% in the last 12 months.