EchoStar Corp. reported a $16.5 billion impairment charge and agreed to sell more spectrum licenses to Elon Musk’s SpaceX for $2.6 billion as it works to unwind parts of its 5G wireless buildout.

The non-cash charge was linked to portions of its 5G network that won’t be used following the sale of spectrum to AT&T Inc. and SpaceX, EchoStar said in its third-quarter earnings statementBloomberg Terminal Thursday. The satellite-TV and telecommunications company also amended a $17 billion September deal with SpaceX to include more licenses for an additional $2.6 billion, it said in a separate statementBloomberg Terminal.