Updated

A sheriff's deputy, a suspected gunman and a bystander were wounded Wednesday afternoon during an exchange of gunfire outside a Tulsa courthouse, sending people scattering from a crowded plaza as an employee at a nearby library used his camera to chronicle the events.

Police spokesman Leland Ashley said authorities responded to a report of a person firing into the air between the Tulsa County Courthouse and the library. Deputies, including the one who was wounded, exchanged gunfire with the shooter, Ashley said.

John Fancher, a communications coordinator with the library, told The Associated Press that he heard gunshots, then grabbed his camera and stood at his office window to take pictures.

"I see a guy barefoot nonchalantly just waving a gun in the air," Fancher said. "I'm thinking this is not the downtown I remember working in. I start snapping off some shots and he sits down, just casually sits down, gun in his hand and three sheriff's come out of the courthouse and I can't hear what they're saying."

Fancher said the man turned around and stood up with his gun.

"That's when (the deputies) did what they had to do," he said.

Ashley said injuries to the deputy and the bystander did not appear life-threatening.

Authorities said Andrew Joseph Dennehy, 23, was being treated at a hospital, but his condition wasn't immediately available. Ashley said he was considered to be in police custody but hadn't been formally charged.

Tulsa County sheriff's Sgt. Shannon Clark said the deputy who was wounded was shot in both hands and both arms and was in surgery as of 7 p.m. He didn't know the extent of the injuries to the deputy, whom the department didn't identify.

Emergency Medical Services Authority Capt. Chris Stevens said one man was taken to a hospital in critical condition and that two other people were hospitalized, one in serious and one in fair condition. A woman, who was not hit by gunfire, was "shaken up" and treated at the scene.

Glyn Roe, 49, a heating and air-conditioning worker from Tulsa who was just visiting the library Wednesday, said he saw all the events unfold.

"Everybody was running," Roe said. "I was watching it to make sure he wasn't coming into the library, or I would have started running, too."

Virginia Jones, owner of Downtown Tulsa Tag Agency, where people can update their car licenses, said she and her son were leaving to pick up another child from school when they heard gunfire.

Police officers crouched behind giant planters that dot the plaza when more gunfire erupted.

"It wasn't long after that that police just started coming from everywhere," she said.

Library Chief Executive Officer Gary Shaffer said he was returning from lunch when he saw emergency vehicles. A man who appeared to have been shot in the leg was wheeled out of the library by paramedics.

Shaffer said it was unclear if the man, who he said was conscious, ran into the library after getting shot or if he was shot in the library. There was broken glass in the library from an apparent bullet.

Tulsa County District Court Judges Jefferson Sellers and Rebecca Nightingale told the Tulsa World that they were in courtrooms on the seventh floor when they saw the gunfire exchange. Nightingale said the gunman fired at least two shots at the deputies, and Sellers said the deputies fired multiple rounds back at him after ordering him to drop the weapon.