WAGM-TV, the Presque Isle-based affiliate of CBS and FOX, avoided a blackout on DISH Network after the station’s parent company reached a last-minute agreement with the satellite television service.

The parent company of WAGM, Gray Television, and its stations had warned of DISH Network subscribers losing access to 99 Gray Television streams, including WAGM, as of 7 p.m. Tuesday, Jan. 17.

Shortly after 7 p.m. Gray Television announced “an agreement in principle” with DISH covering the contract to carry all of its stations. Terms of the agreement were not disclosed.

The contract dispute prompted the television station to warn its viewers that DISH subscribers could lose the channel. WAGM said on its website that DISH has dropped more than 200 local television programs around the country in the past two years.

A spokesperson for the Englewood, Colorado-based Dish Network said in an email before the deal was reached, “DISH has successfully negotiated agreements representing hundreds of stations in recent months that benefit all parties, including our viewers.”