Dallas - Waiting outside a federal courthouse, photographer Tom Fox took in Dallas’ 8 a.m. bustle. People dressed for work got out of cars. A homeless man danced on a street pole.

But when what initially sounded like a truck backfiring clarified into gunshots, the routine assignment for a veteran journalist morphed in a moment.

As shots echoed off the tall buildings, an armed officer dashed past The Dallas Morning News photographer. A man came around the corner half a block away and Fox pulled out his long lens — focusing in on green military-style garb, a mask and a belt full of ammunition. The gun barrel swung around. Fox squeezed off a last frame. And he ran for cover behind a column in the building’s façade.

“I was just praying in that corner that he wasn’t going to pass me,” Fox, 51, told The Associated Press. “I was just afraid he was going to be running with a gun. He was going to pass me, see me, identify me with the camera and shoot me.”

The images Fox made offer a rare in-the-moment glimpse of the type of shooting American journalists have become accustomed to covering after the gunfire has stopped. In capturing the gunman approaching the doors of the federal building, Fox said he acted on instinct reinforced by his colleagues’ experiences blocks away a few years earlier.

Brian Isaack Clyde’s assault on the Earle Cabell Federal Building marks downtown Dallas’ second high-profile shooting by a U.S. Army veteran in less than three years. In July 2016, Micah Johnson shot and killed five law enforcement officers and wounded nine others before police killed him. But Clyde was the only fatality Monday.

“I don’t think, if it wasn’t for the July 7th shootings, that I would have known how to react,” said Fox. “It was just instinctual.”

Officials have praised the training and courage of the Federal Protective Service officers who confronted Clyde, saying their actions likely prevented many more deaths. But little information has emerged on what motivated the attack.