A gunman wounded two workers outside an office Thursday, and a man who recently worked in the building as a security guard was charged in the attack.

Michael Blas Rivera surrendered at his apartment complex, roughly six miles from the Pitney Bowes office where the shooting occurred more than two hours earlier, police said.

Rivera, 31, had worked at the office as a contracted security guard but quit Oct. 19, according to his former employer, Securitas Security Services USA Inc. Detective Stacie Derge said he pulled up in a car in the office's parking lot, exited the vehicle and fired a semiautomatic rifle at two people outside.

The victims, a 29-year-old security guard who replaced Rivera and a 37-year-old assistant manager for Pitney Bowes, were taken to the hospital in critical condition. The unarmed guard, who was shot once, was in stable condition by the afternoon, and the other man, who was shot multiple times, was still undergoing surgery, Derge said.

A bullet also hit a window of a pickup truck driving by. The two people inside were not hurt, Derge said.

Rivera was booked into jail on two counts each of aggravated assault and reckless endangerment.

Rivera called 911 from home and had a brief, calm conversation with an operator before turning himself in to officers outside, Derge said. Police would not disclose what Rivera said in the call.

The Associated Press made a request to interview Rivera, but it wasn't clear late Thursday afternoon whether Rivera had received the request.

His brother-in-law, Alberto Martinez, said Rivera has several guns and rifles but "it's all legal."

"There's no way he's the guy," Martinez said. "He's not that type of guy. He's down to earth. He ain't going to shoot nobody for no reason."

Pitney Bowes spokeswoman Sheryl Battles said there are about 150 employees who work at the building where the shooting occurred, but no one else was injured. The company shut down the office for the day and was providing counseling, she said.

Stamford, Conn.-based Pitney Bowes Inc., a maker of postage meters and shipping systems, has more than 35,000 employees worldwide. The Phoenix office handles sales, document management and other services.

Security guards in Arizona must complete eight hours of training and submit to an FBI background check.

Derge would not comment on whether Rivera had a criminal history. Searches on Arizona court Web sites did not return records on Rivera.

Rivera began working for Securitas USA in March after passing all required checks, company spokeswoman Lynne Glovka said in a statement. She said the company is cooperating with police and helping the wounded guard.

Securitas USA describes itself as the nation's largest security company, with with more than 500 branch offices and about 100,000 security officers. Its Swedish parent company operates in 23 countries.