The deal, which has been unanimously approved by the boards of both companies, values Time Warner at $107.50 a share. After the acquisition the combined market value of the companies would be more than $300bn.
AT&T has more than 130 million mobile phone customers and 24 million pay-TV subscribers, while Time Warner owns Hollywood movie production company Warner Brothers as well as TV networks CNN and HBO.
Announcing the deal in a conference call on Friday evening, AT&T chief executive Randall Stephenson said: "We believe premium content is always going to win. That’s been true on the big screen, the TV screen and we believe it is true on the mobile screen.
"When we combine Time Warner content with our scale and distribution … we’re going to have something really special."
However, both candidates hoping to becoming US president next month have raised concerns about the deal.
Republican US presidential nominee Donald Trump has pledged to block the deal should he win next month’s election. Trump, who has complained about media bias during his campaign against Democrat Hillary Clinton, said the deal would give AT&T too much concentration of power.
Trump has also said he would consider breaking up Comcast’s acquisition of NBC Universal in 2013, claiming that such media deals "destroy democracy".
Meanwhile, a spokesman for Clinton said there were "a number of questions and concerns" about the deal.
A Senate subcommittee responsible for competition will hold a hearing in November.