NEW YORK (AP) — Less than a month before it was due to shut down, the Pittsburgh Post-Gazette said Tuesday it had found a buyer that would keep the troubled newspaper open.

The Post-Gazette dates its ancestry to 1786, the first newspaper to open west of the Allegheny Mountains, and its closure would have left Pittsburgh as the nation’s largest community without a city-based paper.

Its owners, Block Communications, said the Venetoulis Institute for Local Journalism, which publishes the digital Baltimore Banner, had agreed to buy its assets. Financial terms were not disclosed.

The Post-Gazette said the new owners would continue to print the newspaper on two days, Thursday and Sunday, and would operate a website on the other days.

The newspaper had been due to close on May 3.