Chairman and Chief Executive Officer of Time Warner Jeffrey Bewkes (L) speaks with Chairman and Chief Executive Officer of AT&T Randall Stephenson before a Senate Judiciary Committee Antitrust Subcommittee hearing on the proposed deal between AT&T and Time Warner in Washington, U.S., December 7, 2016.

Media stocks are rising after a federal judge ruled in AT&T's favor on its deal to acquire Time Warner.

U.S. District Court Judge Richard Leon ruled Tuesday that AT&T could buy Time Warner with no conditions attached, denying a Department of Justice antitrust challenge.

Time Warner shares were up 2 percent and CBS shares rose more than 3 percent Wednesday, while 21st Century Fox was up more than 6 percent. Netflix also rallied nearly 5 percent.

"TV content stocks [are] surging, post-close, on expectations of a merger wave that we see as sensible—but not without risk," B. Riley analyst Barton Crockett said in a note to clients Wednesday.

Jefferies told clients the ruling may lead to more mergers moves because it raises the perception of a "more lenient regulatory environment" for acquisitions.

"M&A activity across the media and telecommunications landscape has largely been in a holding pattern awaiting the outcome of the T/TWX deal," Jefferies analyst John Janedis said Tuesday. "With the deal approved we think it could spur other M&A activity for the group."