Dramatic end to Tulsa courthouse shooting spree John Fancher / Reuters A gunman holds a gun as Tulsa County sheriff's deputies and other law enforcement officers surround him on the plaza in front of the Tulsa County courthouse in Tulsa, Oklahoma, on Wednesday. A 23-year-old man was arrested Wednesday after he opened fire outside the Tulsa County Courthouse, police said. Three people were injured. Police said the man, identified as Andrew Joseph Dennehy, walked into the plaza outside the courthouse and Tulsa City-County Library and began firing into the air. A deputy fired back, police said. Tulsa County sheriff's Sgt. Shannon Clark said the incident occurred at 2:39 p.m. (3:39 p.m. ET), the Tulsa World newspaper reported. Clark said a deputy was shot in both hands and both arms and was in surgery Wednesday evening. 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. Clark told NBC News on Wednesday that the suspect was in critical condition. Police spokesman Leland Ashley said Dennehy was considered to be in police custody but hadn't been formally charged. The sheriff's office told the local FOX23 station that their security plan was carried out exactly as planned, and that the police officers reacted very quickly. The courthouse was set to be open as usual Thursday, FOX23 reported. 'Everybody was running' The Tulsa World reported that a wedding ceremony had just taken place in the plaza when the gunfire erupted. Tulsa County sheriff's deputies and other law enforcement officers secure a gunman on the plaza in front of the Tulsa County courthouse in Tulsa, Oklahoma, on Wednesday. "The shooter was about 20 feet away from me," Angela Reudelhuger of tulsaweddingminister.com, who had conducted the ceremony, told the Tulsa World. She said the bride and groom's 6-month-old baby was among the wedding guests. "We just jumped inside [the courthouse], and I yelled at the deputy, 'Somebody's shooting!'" she said. Glyn Roe, a heating and air conditioning worker from Tulsa who was 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.