Officer Todd Young, 39, had been hospitalized at Highland Hospital in Oakland since Aug. 27, when he was shot at 2009 Auseon Ave. in Oakland.
Young underwent numerous surgeries and spent 48 days in the intensive care unit but was released from the hospital on Monday, Fremont police spokesman Detective Bill Veteran said.
One of the two bullets that hit him entered through his right groin and exited his lower back. Doctors said he suffered significant bladder and stomach injuries.
Veteran said Young is "recovering well" but the road ahead is a long one that will include several months of rehabilitation and physical therapy.
Young plans to return to work once he has recovered, Veteran said.
According to Oakland and Fremont police, Young was shot at about 2:30 p.m. on Aug. 27 when he and fellow Officer Eric Tang attempted to arrest suspected gang member Andrew Barrington, a 20-year-old Union City man.
The two officers were working in Oakland as part of the Southern Alameda County Major Crimes task force and had a warrant for Barrientos' arrest for an incident in April as well as for allegedly threatening his ex-girlfriend with a gun on Aug. 13.
Barrientos is charged with attempted murder and 12 other felony charges. His preliminary hearing, which will determine if there's enough evidence to have him stand trial, is scheduled to begin next Wednesday.
Two other men have also been charged in the case for allegedly helping Barrientos flee after the shooting. They're being prosecuted jointly with Barrientos and will be with him at the preliminary hearing.