Minneapolis police arrested a former convict with a violent history in connection with what may have been a targeted ambush of an officer responding to a burglary call early ­Saturday.

Andrew J. Neal was arrested about 1:30 p.m. at a home at 1119 Logan Av. N., after the address was surrounded by a SWAT team and other officers. Neal was arrested on a charge of violating probation, probable-cause burglary and probable-cause domestic aggravated assault.

Police were still investigating the link between the domestic incident and the shooting and declined to say whether Neal was the suspect in the shooting. He has ­previously served time in prison for first-degree assault and has an extensive arrest record.

Minneapolis Police Chief Janeé Harteau met with the injured officer and his family at the hospital. She said she believes the officer was ­targeted.

"There is little doubt that an officer was the intended target of this shooting and that this officer just happened to be the one who was there," Harteau said in a statement.

The officer was identified by a source close to the investigation as Jordan Davis. He was taken by his partner to North Memorial Medical Center in Robbinsdale, where he was in satisfactory ­condition. A nurse at North Memorial who declined to give her name said that "Jordan Davis was discharged." An operator at the hospital said she believes the officer was released from North Memorial Saturday evening.

A 2008 graduate of the police academy, Davis is a patrol officer from the Fourth Precinct. He was recognized by the department as a "DWI All-Star" in 2013 for making 110 DWI arrests.

"This is an example of what can happen so fast in a cop's job,'' said police union chief John Delmonico. "They believe that law enforcement was the target — not this specific cop — and he never saw it coming."

Minneapolis Mayor Betsy Hodges called the shooting "a cowardly act."

The two officers had just finished handling a burglary call on the 1100 block of 24th Avenue N. in the Jordan neighborhood, police said. Davis was shot while standing outside their squad car.

"It was right next to us," an officer is heard saying on a police audio from the scene. "We did not see anybody. It came out of nowhere."

The tenant who reported the early morning burglary spoke on condition of anonymity for fear for her safety. She said Neal had smashed in her kitchen window with a hammer. A friend was able to chase Neal, whom she knows, off the property with a pocket knife, she said.

The tenant immediately called police, she said. Officer Davis was shot outside after taking her statement.

An area near 24th and Fremont avenues was cordoned off for several hours afterward. Police dogs were seen searching nearby garages and alleys for the suspect.

Ron Edwards, a member of a community committee recently created by Harteau, said efforts were made by North Side residents to get the gunman to surrender to prevent further violence.

Brandi Olson, who lives in the 2300 block of Fremont Avenue with her mother, husband and two young children, said her mother heard a single gunshot early Saturday.

"Generally we really like it here," she said, adding that her neighbors are all friendly. "But when something like this happens it makes you ­nervous."

Nearby resident Derrick Neal wandered over to the scene to see what had ­happened. Neal was relieved when he saw his 20-year-old brother, who had been in the area visiting a friend, on one of the city buses where police were holding residents whose houses were being cleared in the search for the gunman.

"I'm feeling sad because this is our community. I know a lot of stuff has been happening with black people and police and stuff, but people have gotta grow up," Neal said.