A suspect who barricaded himself inside a house after allegedly shooting a Detroit police officer Wednesday evening was taken into custody early Thursday morning.

The unidentified suspect allegedly tried to escape after police tossed tear gas into the home following a standoff, WDIV-TV reported.

The unidentified officer remained in critical condition in a local hospital and was undergoing surgery, the station reported.

Police said the shooting occurred after officers responded to a domestic violence call on the city's east side shortly before 11 p.m. Wednesday.

The suspect has a wife and children who were safely out of the house, according to police.

As the standoff was underway, Metro Detroit police advised residents via Twitter to stay away from the area.

The officer was brought to Detroit Receiving Hospital. He suffered a serious head injury, according to reports.

Earlier Wednesday, two Michigan state police officers were shot while serving a search warrant related to a cold case investigation, officials said.

Detective Sgt. Aaron Steensma was shot in the chest, and Trooper Daniel Thayer was shot in the chest and hand, state police confirmed in a news release.

This is a developing story. Check back for updates.