RELATED: New details emerge from chaotic night when Raleigh police officer was shot
Officials said they have the two suspects in custody, one of whom was shot and is receiving medical treatment. Police haven't released the names of the officers or the suspects.
Birmingham Police Chief Patrick Smith said the officers approached the two suspects just before 2 a.m. outside a nightclub in downtown Birmingham, after a plainclothes officer spotted one checking door handles on cars parked outside the venue. Smith said one suspect opened fire after being confronted by the officers.
"This is one of the roughest hours of your career," Smith said at a news conference, according to local media reports. "There's not a chief, not an officer that ever wants to have to deal with this. This is a very difficult thing for the family, very difficult for the department."
Officers were working a special detail in response to a rash of car break-ins in that area. When the undercover officer spotted suspects who appeared to be testing door handles on cars, he called for backup and the sergeant arrived, officials said.
"The officers approached one suspect and patted him down where they found what they believed to be a weapon," Smith said. "They asked him about it, he armed himself and fired upon our officers."
Smith added: "It appears our officers were unable to respond. They were taken completely by surprise. We can't go into great detail because we are still in the infancy stage of the investigation."
News outlets said this is the first Birmingham officer killed in the line of duty in more than 14 years.
RELATED: Suspects arrested in connection with shooting of Raleigh Officer Charles Ainsworth
Birmingham Mayor Randall Woodfin called for prayers on Twitter.
"Join me in praying for the family of the Birmingham Police officer killed early this morning, and the officer who is currently in the hospital. They were shot while serving and protecting our city," he tweeted.
U.S. Attorney Jay E. Town issued a statement calling the shooting "a heartbreaking reminder of the dangers all law enforcement face while we sleep."
'Gun violence hurts everyone:' Raleigh police chief gives update on Officer Ainsworth
Timeline: What happened the night Raleigh police officer Ainsworth was shot
After tense relations with RPD, community advocates respond to officer shooting
Love, support shared on social media for shot Raleigh officer