AT&T Inc. is preparing to spin off its media business and merge it with with Discovery Inc. in a tax-friendly deal, according to people with knowledge of the matter, a surprise reversal for a company that spent $85 billion to acquire the assets less than three years ago.

A deal could be announced as soon as this week, said the people, who asked not to be identified because the information was private.

The transaction will be structured as a so-called Reverse Morris Trust, or a merger with another company that’s structured to be tax-free, one of the people said.