Amid mounting debt and after months during which the threat of closure hung over its head, Channel 10 on Tuesday was spared for at least another two years thanks to an agreement between the television outlet’s owners and the government.

Under the terms of the agreement, the state will loan the channel NIS 65 million ($17 million) to enable the company to pay back the massive debt it has accumulated — comprising mostly state royalties and licensing fees. Channel 2 concessionaires Keshet and Reshet were offered a loan option with similar terms, presumably to avoid the appearance of favoritism.

Harel Locker, the director-general of the Prime Minister’s Office who headed the committee that sought a solution to the station’s debt crisis, met with Finance Minister Yuval Steinitz Sunday evening to hash out the final details of the debt settlement plan.

The station will be fully exempt from franchise fees and royalties next year. Its license will also be extended for another two years, although executives had applied for a three-year extension, which was the time frame previously given by the Finance Ministry for turning the company’s finances around.

Another condition set out by the Locker committee was that half the loan be contingent on Ron Lauder, Channel 10’s main shareholder, pledging bank securities; the other portion would be granted against financial collateral. Lauder said he would meet the financial conditions.

The understanding between the shareholders and the Locker committee was passed on to the Communications Ministry, which was to draft a bill for the legislation required in order to extend the station’s licenses — which, coincidentally, expire at the end of December.

The station has been plagued with severe financial problems since its inception, and its executives have been at a lengthy impasse with the government over debt-structuring plans. In August, Channel 10 sacked 150 staffers, about one third of its manpower.