KANSAS CITY, Kan. -- An inmate overpowered two sheriff's deputies while being transported to a Kansas City courthouse on Friday, resulting in a shooting that killed one deputy and critically wounded the other, authorities said. The suspect was also shot during the confrontation in a gated area near the Wyandotte County Courthouse in Kansas City, Kansas.

Investigators said the inmate may have grabbed a weapon from one of the deputies during a struggle after he got out of a van transporting him late Friday morning. The inmate was shackled and in handcuffs, reports CBS affiliate KCTV.

"It is very possible that with their own firearm, they were both shot," sheriff's Maj. Kelli Bailiff said during a news conference at the University of Kansas Hospital.

Get Breaking News Delivered to Your Inbox

The slain deputy was identified later Friday as 35-year-old Patrick Rohrer, who had been with the department for seven years.

The wounded deputy and the suspect were undergoing surgeries Friday afternoon. No other information has been released about the deputy or suspect.

Bailiff said the inmate was being taken across the street from the jail, to the services building, for a court hearing. The inmate was taken in a van to a gated area behind the building, and when he got out of van, he somehow overtook and shot the deputies, Bailiff said.

Authorities said it was too early in the investigation to publicly detail how the shootings could have happened. Investigators will be reviewing surveillance video, according to Kansas City Police Department spokesman Zac Blair. The department is leading the investigation.

The scene outside a Kansas City courthouse where two deputies were reportedly shot Friday. KCTV

Bailiff said investigators do not believe the public is in any danger. Video from the scene showed the courthouse surrounded by yellow police tape, several police vehicles parked in the street and numerous uniformed law enforcement officers walking the grounds.

A witness who was inside the courthouse told KCTV he heard gunfire, looked outside, and heard a woman screaming. Then he saw two officers being loaded into an ambulance taken away.

He said the courtroom he was in was placed on lockdown. He was able to leave more than an hour later.

"Right when I walked into the courtroom they pushed us into the corner of the courtroom, then I saw one officer being carried away with blood on their chest and another officer being carried away," John Garcia said.

Kansas Gov. Jeff Colyer was briefed on the shooting as he arrived at Children's Mercy Park for a congressional forum hosted by the Kansas City, Kansas, Chamber of Commerce, The Kansas City Star reported. He offered a moment of silence for the deputies after he finished his speech at the event.

He said law enforcement officers were doing their jobs and investigating even as they dealt with violence against two of their own. He noted that the county and the city have dealt with other officer shootings in the recent past.

Two Kansas City officers were shot and killed within less than three months in 2016. Capt. Robert Melton was slain in July while searching for a suspect in a drive-by shooting. Melton was part of the police honor guard for Det. Brad Lancaster, who was fatally shot earlier in 2016 near the Kansas Speedway.

In 2015, Wyandotte County Deputy Scott Wood was shot seven times but survived.