A Sonoma County sheriff’s deputy was injured while chasing an inmate who tried to escape during a visit to Sutter Santa Rosa Regional Hospital on Thursday, authorities said.

The unnamed deputy was struck in the head by a swinging metal door as she chased inmate Yesenia E. Carranza as she fled through the door, sheriff’s Sgt. Spencer Crum said in a statement.

Carranza, 29, had been serving a 30-day sentence at the county’s main detention center on misdemeanor drug charges when she was taken by ambulance to Sutter hospital Thursday afternoon for undisclosed medical reasons, authorities said. She had been in custody since Sunday.

A deputy was guarding her during a medical procedure, per standard protocol, when Carranza suddenly fled shortly after 2:30 p.m., authorities said.

“It all happened fairly quick,” sheriff’s spokeswoman Misti Harris said. “She didn’t get very far.”

Crum said hospital security soon apprehended Carranza, an El Sobrante resident.

She was booked back into jail, where she was being held without bail on Thursday evening. Carranza now faces felony charges on escape and resisting arrest resulting in serious injury.

The deputy was badly hurt and was admitted to a local hospital out of caution, but was expected to be all right, authorities said.

You can reach Staff Writer Susan Minichiello at 707-521-5216 or susan.minichiello@pressdemocrat.com.