Media and telecommunications stocks shot higher in extended trading Tuesday after a federal judge ruled in AT&T's favor on its $85 billion deal to acquire of Time Warner.

Time Warner shares traded more than 5 percent higher in aftermarket trading.

The widely anticipated ruling comes amid pent-up interest in forging combinations across the entertainment and communications industries. CNBC's parent company, Comcast, has been eyeing a $60 billion offer for the Twenty-First Century Fox studio and production assets that are currently part of a deal with Disney.

Comcast was reportedly waiting for a favorable ruling to unleash its offer for Fox. And many believe it would set off a flood of other dealmaking. Strategas said in a research note that companies brought $296 billion back to the U.S. from overseas operations in the first quarter after the tax cuts and "are flush with cash to do deals."

Fox rose more than 5 percent.

Shares of Comcast were lower in aftermarket trading, while Disney fell 1.5 percent.

Viacom and CBS have also been dancing around a deal, and their shares rose 0.95 percent and 1.6 percent, respectively. AT&T shares were flat in aftermarket trading.