Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The New York Times, assailed by President Donald Trump as "failing," signed up more than 200,000 paying online subscribers in the third quarter, helping it top Wall Street estimates for both profit and revenue.

Shares in the publisher rose 8 percent after quarterly results on Thursday showed digital-only subscribers rose to 3.1 million at the end of September, the result of a combination of aggressive discounting and heavy spending on marketing.

The company's stock has now risen 54 percent in value this year.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"NYT is successfully making the transition to a digital platform from a print-based model and continues to be one of our best long-term investment ideas in the internet/media sector," said Douglas Arthur, an analyst at Huber Research Partners.

Online subscriptions have become central to the Times' future as revenue from print advertisements dries up. The increase was the highest since a bump at the start of last year driven by Trump's repeated mentions of the paper.

In early September, Trump railed against an anonymous op-ed in the Times that said senior officials in his administration were working from within to frustrate parts of his agenda.

The paper has continued to discount heavily while marketing itself as a source of unbiased reporting in a deeply divided America. Some digital subscriptions begin at just $1 a week.

"The first, and probably most significant driver, was the $1 a week introductory offer domestically, which ran I think the last six weeks to the quarters," Chief Operating Officer Meredith Kopit Levien said on a conference call with analysts.

The company's digital advertising revenue, now responsible for over 70 percent of overall advertising revenue, jumped about 17 percent to $57.8 million in the third quarter, while print advertising revenue continued to decline.

The newspaper's net income, however, fell 22.7 percent to $25 million, as total expenses climbed 8.4 percent, led by higher marketing costs.