AT&T Inc. has reached an agreement to buy Time Warner Inc. for $85.4 billion in a deal that would transform the phone company into a media giant.

The wireless carrier agreed to pay $107.50 a share, evenly split between cash and stock. The companies said they expect the deal to close by the end of 2017.

...