From left: Officer Garrett Crumby, 36, and Officer Albert Morin, 34, of the Huntsville Police Department in Alabama.
CNN  — 

One Alabama officer died and another is in critical condition after they were shot by a suspect who barricaded himself inside an apartment as they were responding to a reported domestic violence attack on a woman in Huntsville, officials said.

Both officers were taken to a hospital following the Tuesday shooting and one of them died there, the Huntsville Police Department said in a news release.

In a Wednesday update, the police department identified the officer who died as 36-year-old Garrett Crumby.

Alabama Attorney General Steve Marshall said Crumby was a three-year veteran of the Huntsville Police Department and the first Alabama officer to die in the line of duty this year.

The other officer, who remained hospitalized in critical condition Wednesday, was identified by police as 34-year-old Albert Morin.

Officer Garrett Crumby died after being shot by the suspect.

“Tonight, our State grieves the death of another member of the law enforcement community — one who, when called upon, ran toward danger in aid of a female victim and her two small children,” Marshall said.

The two officers were “ambushed” by a suspect who had shot and wounded a woman.

The woman called 911 around 4:45 p.m. local time and reported she had been shot at an apartment building.

The suspect shot the first two arriving officers, Crumby and Morin.

The suspect was injured and hospitalized.

Police arrested and charged 24-year-old Juan Robert Laws with capital murder of a law enforcement officer and he is being held in the Madison County jail on no bond, according to jail records.

It is unknown if Laws has an attorney.

The injured woman was also taken to a hospital, Deputy Chief Michael Johnson said during a news conference. Her injuries were non-life threatening, he noted.

Officer Albert Morin is hospitalized in critical condition.

Police chief Kirk Giles said the officer’s loss is devastating to the community.

“We send our heartfelt condolences to the officer’s family as they mourn their loved one who made the ultimate sacrifice. As we grieve with our fallen officer’s family, we have another officer fighting for his life. Please keep all our officers and the entire department in your prayers,” Giles said.

Huntsville Mayor Tommy Battle said Tuesday was a “painful night for the City of Huntsville and for our police family.”

“We are heartbroken. Words cannot express our loss. We have been overwhelmed by the show of love and support from our community, and we stand united with our police officers and their families in this tragic moment,” he said in a news release.

The deceased officer will be taken to the Alabama Department of Forensic Sciences in Huntsville, and an autopsy is set to be conducted on Wednesday.

CNN’s Jamiel Lynch contributed to this report.