(KRON) — A San Jose Police Department officer who was shot in the line-of-duty nearly a month ago remains in critical condition.

“The officer is in critical condition, but is stable,” an SJPD spokesperson told KRON4 on Tuesday.

On August 16, the officer responded to a tearful 911 call from a pregnant woman reporting that she was being attacked by her drunk husband inside their townhome on Auzerais Avenue.

The husband, 44-year-old Gabriel Mario Carreras, attempted to punch his wife in her stomach and said he wanted to “get rid of the baby,” according to court records.

When the two officers arrived at the couple’s townhome, Carreras “ambushed” the female officer and opened fire from a balcony, police said. The officer, identified in court documents as “Officer A,” and her partner, Officer Low, never returned fire.

“Officer Low stated he heard a loud bang and saw Officer A. fall to the ground,” court documents state.

The female officer was struck by a bullet below her bulletproof vest before Officer Low dragged her out of the line of fire.

The female officer suffered life-threatening injuries, police said. A trauma ICU physician said the gunshot wound resulted injuries to the officer’s intestine, colon, liver, and a spinal fracture.

The case is a “heart-breaking example of domestic violence, and an inspiring case of police heroism,” Santa Clara County District Attorney Jeff Rosen said.

Pregnant woman describes terrifying attack

The victim told police that she was four weeks pregnant. On the morning of August 16, she returned home and found her husband packing his clothes to move out. He was heavily intoxicated from drinking tequila, the victim told police.

“He did not want to stay in the relationship, did not want anything to do with her, and told her to ‘get rid of the baby,'” SJPD Detective Amanda Estantino wrote in court documents.

The terrified woman ran into a bathroom, shut the door and began crying. “Carreras violently pushed open the door, breaking it off the hinges, approached her with a clenched fist, and attempted to punch her in the stomach. She cowered backwards and screamed for him to stop several times. He swung toward her stomach,” Estantino wrote.

The woman called 911 and fled into a bedroom before Carreras smashed her phone, according to Estantino. The woman heard a gunshot after the two officers arrived at the townhome.

“Carreras entered the bedroom and told her that everything was her fault, and that because of her, he shot — and may have killed — a cop,” Estantino wrote.

Police surrounded the townhome and a 4-hour standoff ensued. Carreras fell asleep and dropped the gun next to him, Estantino wrote. His wife tucked the gun behind her back and walked out of the townhome with her hands up.

Carreras remains behind bars with no bail. Prosecutors charged the felon with attempting to murder a police officer, as well as several firearm and assault-related felony charges.

District Attorney Rosen said, “An officer lies badly wounded in the hospital for trying to save a pregnant woman. As we give our sincerest thanks to her and her heroic partner, we are determined to make sure this suspect will never see a gun, or freedom again.”

Carreras will face a life prison sentence if he is convicted, prosecutors said.