The ruling brings to an end a six-week antitrust trial which heard regulators argue that the deal, worth $85m (£63.5m), would give AT&T undue leverage against rivals that rely on Time Warner content.
Judge Richard Leon of the US District Court for the District of Columbia said in his ruling that the government had “failed to meet its burden to establish that the proposed transaction is likely to lessen competition substantially”.
The Justice Department had said the acquisition would hurt competition in the pay TV market, and assistant US attorney general Makan Delrahim said he was “disappointed” with the court’s ruling.
He added: “We continue to believe that the pay TV market will be less competitive and less innovative as a result of the proposed merger between AT&T and Time Warner.
“We will closely review the court’s opinion and consider next steps in light of our commitment to preserving competition for the benefit of American consumers.”
AT&T had said it needed Time Warner to compete with the likes of Amazon, Netflix and Google, and that the deal would improve technology and give consumers more choices.
David McAtee, AT&T general counsel, said: “We are pleased that, after conducting a full and fair trial on the merits, the court has categorically rejected the government’s lawsuit to block our merger with Time Warner.”
Jennifer Fritzsche, senior analyst at Wells Fargo, said the ruling was the “best case scenario” for AT&T.
She added: “Not only was the deal approved, but the judge did not impose any conditions on the merger, and went so far as to encourage Department of Justice not to file a stay pending appeal.
“We fully expect (AT&T) to close the acquisition on 18 June (the earliest possible date).”
The approval could encourage other companies pursuing similar tie-ups.
Also affected could be Comcast’s attempt to beat Disney to win control of 21st Century Fox’s TV and film businesses.
Comcast, the largest US cable supplier, was waiting for the AT&T decision before making any large moves, according to sources.
John Hodulik, an analyst at UBS, said the AT&T decision could “serve as a ‘green light'” for other mergers and acquisitions, including Comcast’s of Fox.
That agreement also covers the intended purchase of the 39.1% stake in Sky, the owner of Sky News, that Fox currently owns.
Mary Ann Halford, senior adviser to OC&C Strategy Consultants, said: “Regardless of what happens on the appeal front, expect Comcast to put forth an all-cash bid in the next day or so at a premium to Disney.
“All I know is that this will be a blockbuster summer for media mergers.”