The man suspected of being the gunman in a violent confrontation that wounded a federal immigration officer and three local policemen surrendered early Saturday after an hours-long standoff in a Sacramento suburb, authorities said.

Samuel Nathan Duran, 32, a known gang member on parole, was booked in Roseville’s jail and then taken to the Placer County lockup, according to city officials.

The federal Immigration and Customs Enforcement agent was shot in the leg Friday as he and other officers made initial contact with Duran at about 3 p.m., Roseville police Lt. Cal Walstad said.

During a later exchange of gunfire, after Duran fled, two Roseville police officers were hit by gunshots — one in the jaw and the other in the shoulder — and a third officer sustained shrapnel wounds from rounds that hit near them, Walstad said.

Two of the officers were listed in stable condition at Sutter Roseville Medical Center, and a third was in serious condition.

As helicopters circled overhead and armored vehicles and other police descended on the area Friday night, the suspect burst in on a family of three. The residents, however, managed to rush to the rear of the house and call 911. That’s when police advised them to escape through a sliding glass door in the back, setting up the standoff that lasted nearly nine hours.

In anticipation of a violent climax, officials had nearby residents transported to a community center to spend the night.

A robot was sent into the home at around 11 p.m. Friday, and just before 12:30 a.m. Saturday the suspect emerged from the home and was taken into custody.

Law enforcement had been searching for Duran in the area for at least 10 days before finding him on Friday afternoon, Walstad said. When officers finally caught up with him, he opened fire, wounding the federal immigration officer who was on the scene to provide support for the Roseville police.

The suspect then ran off and jumped a fence, with dozens of other officers in pursuit.

Walstad said Duran was believed to be carrying an “assault-type weapon.”

The shootout created panic and chaos in a typically quiet middle class suburb of about 120,000. Walstad described multiple shooting sites as the suspect tried to escape a swarm of charging law enforcement officers, and reporters on the scene described hearing several volleys of gunfire.

Police Chief Daniel Hahn said the Roseville officers were all male and veteran members of the force. Hahn said none of the injuries appeared to be life-threatening. No civilian injuries have been reported. Reports suggest Duran had injuries to his hand and face.

U.S. Immigration and Customs Enforcement spokeswoman Virginia Kice said that agency’s officer was stable and alert after being taken to a hospital.

Deborah Hoffman, a spokeswoman for the California Department of Corrections and Rehabilitation, confirmed that Duran is a parolee and that she has been asked not to provide any more information about why he had been imprisoned or when he was released.

A Sacramento-area news station reported Duran is from Roseville, where he attended Oakmont High School but did not graduate. In 2009, he was arrested for attempted carjacking and resisting arrest. Family members said Duran was wanted for a recent incident involving a knife.