(Reuters) - For U.S. media companies and investors, it was the ruling of the decade.

Smartphone with AT&T logo is seen in front of displayed Time Warner logo in this picture illustration taken June 13, 2018. REUTERS/Dado Ruvic/Illustration

A federal judge in Washington had sole power to decide whether telecoms company AT&T Inc could buy Time Warner Inc, the parent of HBO, CNN and Warner Bros, for $85 billion and reshape the U.S. media landscape.

After a six-week long trial, Judge Richard Leon set a hearing date of June 12 at 4 p.m. (2000 GMT) to announce his ruling. People were so keen to get a seat in his courtroom that they took turns standing in line more than 24 hours ahead of the event.

Reuters reporters Diane Bartz and David Shepardson stood in line from 7 a.m. that morning to secure two of the 27 seats reserved for reporters. Shepardson’s seat was the more advantageous of the two, nearer the aisle.

Leon’s rules were simple, but a nightmare for reporters working in a real-time, all-digital news environment.

First, everyone in his courtroom was barred from having active electronic devices with them, and court officials tested each as people entered the court.

Second, no one could leave until Leon had completed reading an abbreviated recap of his 172-page ruling and had left the courtroom himself. One of Leon’s clerks said the only exception would be for people “on a gurney.”

With those rules in mind, Reuters had another reporter, Ginger Gibson, outside the courtroom with a series of prepared alerts ready to transmit from her laptop covering a range of possible outcomes. Gibson was set up just outside the door where she could see a signal from Bartz or Shepardson telling her which alert to send.

Immediately after the courtroom doors closed, however, another court official forced everyone who did not go into the hearing to clear the hallway. The last-minute twist meant Gibson was not where her colleagues would expect her to be when they came running from the court.

Inside the courtroom, Leon delivered his ruling: AT&T could proceed with the Time Warner purchase with no restrictions, widely seen as a green light to further media-telecoms mergers worth hundreds of billions of dollars.

When Leon finished, Shepardson - a former high school hurdler - made a dash for the aisle and the door, vaulting briefcases and people. He burst through the crowd into the hallway looking for Gibson, who was no longer where he had left her.

But she had managed to stay in a position where she could see the door, and as it opened she ran forward with her open laptop, meeting Shepardson halfway down the hall. The ruling matched one of the prepared scenarios, and they sent the alert - 10 seconds ahead of the competition.

The market reacted immediately.

Within minutes, Time Warner shares were up more than 4 percent while those of AT&T tumbled 5.5 percent. Shares of Twenty-First Century Fox, seen as one of the key properties to be put into play by the ruling, shot up 6 percent in less than three minutes.