An ex-convict accused of shooting and wounding two unarmed officers inside a central California jail is behind bars, facing charges of attempted murder and possessing a handgun as a felon, authorities said.

Thong Vang, 37, also was booked on suspicion of bringing drugs into a jail and placed on a parole hold, the Fresno County sheriff's office said.

He's accused of shooting correctional Officers Juanita Davila and Toamalama Scanlan in the head and neck areas during a struggle Saturday, sheriff's spokesman Tony Botti said. The pair were hospitalized Sunday in critical condition.

Vang was released from prison in 2014 after serving 16 years for raping three girls aged 14 and under, Botti said. He had no criminal violations since his release.

Scanlan, who has 10 years of experience, and Davila, an 18-year veteran, approached Vang after he tried to cut to the front of the visitors' line and began pacing near a secure area of the Fresno County jail.

The officers were trying to get him to sit down when shots rang out. About 15 people, including small children, ran to safety.

Officers from the secure areas inside the jail ran to the lobby, where a lieutenant shot at Vang, who returned fire, Botti said. No one was hit.

Officers tried to subdue Vang with a stun gun, but he would not give up and ran to the hallway of the jail records area, authorities said. When confronted by sheriff's deputies and a Fresno police officer, Vang dropped his weapon and told authorities he wanted to be arrested, Botti said.

The injured officers were dragged out of the lobby and taken to the hospital to undergo surgery. Vang was taken to the hospital for minor scrapes and cuts.

Christy Rodriguez told the Fresno Bee newspaper that she and a woman with a walker hid in the bathroom after they heard the gunshots. Moments later, an officer yelled at them to get out of the building.

"This is crazy. This isn't supposed to happen," Rodriguez said.