The New York Times building in New York City.

New York Times Co. reported its second quarterly loss in a row as print and digital advertising sales declined.

Print ad revenue fell 14.1 percent, the eighth straight quarterly decline. Digital ad revenue, which accounts for about a third of total ad revenue, dropped 6.8 percent, the second straight quarterly decline.

The Times posted a net loss of $211,000 attributable to shareholders for the second quarter ended June 26, compared with a profit of $16.4 million the year-earlier quarter.

On an adjusted basis, the company earned 11 cents per share from continuing operations, matching the average analysts' estimate, according to Thomson Reuters I/B/E/S.

"Advertising was tougher in the quarter, particularly on the print side," Chief Executive Mark Thompson said in a statement on Thursday.

"In digital, we saw very strong growth in mobile, video and virtual reality, branded content and programmatic advertising."

However, this was not enough to offset declines in traditional web display, which led to an overall decline in digital advertising, he said.

"We expect that situation to improve in the second half of the year; in fact, we are already seeing a marked turnaround in July," he said.

Like other newspaper and magazine publishers, the Times has found it difficult to cope with a steady decline in print ad revenue in recent years.

In an attempt to overcome this, the company has been pushing into digital offerings with investments in technology and initiatives such as distributing Cardboard virtual reality headsets to subscribers.

The Times has said that 2016 would be "an investment year" and that it would invest more than $50 million over the next three years to strengthen its digital presence outside the United States.

The company's shares, which closed at $12.79 on Wednesday, were untraded before the opening bell. The stock has fallen about 5 percent since the start of the year.