The Associated Press
This undated booking photo provided by the Maricopa County Sheriff’s Office shows Joseph J. Sandoval, 26. Sandoval is accused of opening fire on Phoenix police officers early Saturday, Nov. 25, 2011, seriously wounding one officer, then holding off a SWAT team for hours before surrendering.

PHOENIX — A gunman who wounded a Phoenix police officer investigating a disturbance at a trailer park early Saturday was finally taken into custody after an hours-long standoff with a SWAT team.

The suspect who had been holed up in a trailer since about 1 a.m. surrendered just before dawn, police spokesman Sgt. Steve Martos said. He was identified as Joseph Sandoval, 26, and was booked into jail on assault and weapons charges, plus a warrant for violating parole. He will be assigned a lawyer after his initial court appearance.

The Arizona Department of Corrections website shows that Sandoval was released from prison two weeks ago after serving four years for weapons violations and theft convictions.

SWAT team members had surrounded the trailer at the park about three miles east of downtown Phoenix after the officer was shot while investigating a trespassing call.

The injured officer was pulled from the line of fire by fellow officers and driven to a hospital by a sergeant, Martos said. His injuries were considered life-threatening, but doctors were able to stabilize his condition in surgery and he was much improved and in stable condition Saturday afternoon, Martos said.

He was one of two officers fired at while investigating reports that several people were in a trailer that was supposed to be vacant, Martos said.

Most of the people in the trailer fled as the two officers arrived.

"As they approached the trailer, one officer was met by gunfire and was struck multiple times," Martos told The Associated Press.

The other officer was unhurt but pinned down for more than an hour as "the suspect continued to fire rounds," Martos said.

Eventually, SWAT team officers were able to provide enough cover for the officer to safely withdraw.

No one else was hurt, but a few adults and several children in the park were evacuated as a precaution, Martos said.

The injured officer's name wasn't released, but Martos described him as being 30 and with the department for nearly four years.