At a pre-trial hearing, Leon said he will hear up to two days of motions before hearing opening arguments on Wednesday.

Lawyers for the government and both companies did not comment on Leon's estimate on the length of the trial; they had previously suggested it would last three weeks.

The U.S. Justice Department filed a lawsuit in November to stop AT&T, which owns DirecTV and other products with 25 million subscribers, from buying movie and TV show maker Time Warner, which owns HBO and CNN, among many other channels, saying it could raise prices for rivals and pay-TV subscribers while hampering the development of online video.

The judge will hear arguments on a number of objections including whether some emails can be introduced as evidence and how to handle potentially confidential information during the trial.

Shares of AT&T closed nearly unchanged at $37.04, while Time Warner closed up 0.5 percent to $96.88.

Leon warned reporters not to use electronic devices and said they could be banned from the courtroom and held in contempt of court if they violated the prohibition.

He also discouraged the government and companies from attempting to try the case in the press, saying his goal was to ensure both sides receive a fair trial. "The case will be tried in this room," Leon said.

After the hearing, Leon told both sides to "Get your rest" before the start of a lengthy trial.

(Reporting by Jessica Toonkel and David Shepardson; Additional reporting by Diane Bartz in Washington, D.C.; Editing by Tom Brown and Leslie Adler)

By David Shepardson and Jessica Toonkel

Stocks treated in this article : Time Warner, AT&T