According to Fresno police, a shooting happened at Courthouse Park in Downtown Fresno Friday.

The moments of uncertainty put the courthouse on lockdown for 45 minutes.

Investigators say Anthony Simpson had a plan this morning when he confronted his ex-girlfriend with a gun.

Authorities say Simpson targeted his ex-girlfriend and an unidentified man she was with Friday morning at the wrong place because, within seconds, officers from several agencies were running toward the sound of gunfire.

"I can't imagine that the suspect thought that he was even going to get away with this with all of the law enforcement officers," Fresno County Sheriff Margaret Mims.

Detectives believe Simpson targeted his ex moments after she left the Sisk Courthouse with a restraining order against him. She was headed to the sheriff's office to file it when she and her male acquaintance were confronted.

"From what the witnesses say and what the video shows, it shows the suspect running towards both of the victims with no conversation," Mims said. "He just came into the picture running full speed towards both of the victims. They started running away."

Sheriff's Margaret Mims brief's reporters on the investigation into the shooting at Courthouse Park in Downtown Fresno.

The unidentified 57-year-old man was shot, but Simpson's ex-girlfriend got away. She continued to sheriff's headquarters and was banging on a side door until she was let in.

Outside, Fresno Police officers were running after the armed man.

"There was a lot of officers involved," Lt. Joe Gomez of the Fresno Police Department said. "Officers on foot following him. Motor officer here was the first broadcast here that got him in custody. I even understand the chief was here."

One witness thought he was hearing fireworks until the shooting victim ran up to him.

"He shot him right here in the shorts, you can see the bullet hole went through his shorts," the witness said. "He shot him in the leg and you could see it right there, all the blood leaking right there and stuff."