A suspect is in custody after surrendering to police, but not before he held them at bay for a few hours Monday night and shot at officers in Oakdale.

Events unfolded about 10 p.m. Monday when police received a call about a domestic situation and attempted to stop a vehicle. The suspect did not immediately stop. When he did, the suspect jumped out of the vehicle in the vicinity of 4th Street and Greystone Avenue and fired at police as he ran inside a residence, authorities said.

At least one Oakdale officer exchanged gunfire with the suspect, Oakdale Police Chief Nick Newton said.

A mother and her baby inside the vehicle with the suspect were rescued and unharmed, authorities said.

Law enforcement from several agencies and a SWAT team surrounded the house, and those living nearby were asked to shelter in place. Some were evacuated from their homes, police said.

The situation was resolved about 12:30 a.m. when the 25-year-old suspect surrendered to police.

The suspect was taken to the Washington County jail and booked on several felony charges, including assault, possession of a firearm by a person convicted of a crime or violence, and domestic abuse no-contact order violation. The Star Tribune generally does not name suspects until charges are filed.

"I am incredibly grateful to the Oakdale Police Department and our partners in law enforcement for resolving this situation with no loss of life," Mayor Kevin Zabel posted Tuesday morning on Facebook. "At the same time, we all know this situation could have ended much different. Violence, but especially violence against law enforcement needs to stop."

The standoff comes weeks after a domestic incident in Burnsville in which two police officers and a firefighter-paramedic were killed.