The deal prevents the scheduled closure of the city's largest publication.