Los Angeles (CNN) -- A former transit police officer convicted last year in the shooting death of an unarmed man on an Oakland, California, train platform will be freed from prison early Monday morning, according to a court order.

Johannes Mehserle was sentenced to two years in prison for the involuntary manslaughter conviction, but California law gives him one day of good conduct credit for each of the 365 days he's already served behind bars, Los Angeles Superior Court Judge Robert Perry said in an order signed Friday.

Mehserle, a Bay Area Rapid Transit police officer when the shooting occurred, said at the trial that he intended to draw and fire his Taser rather than his gun when he fatally wounded 22-year-old Oscar Grant on New Years Day 2009.

Mehserle, who has been behind bars since a Los Angeles jury found him guilty on July 8, 2010, will be free to walk out of prison just after midnight Sunday, Perry said.

Violent protests erupted in Oakland last November when Perry sentenced Mehserle to just two years in prison, which meant he would possibly be released after another seven months.

At least 150 people were arrested during the protests, which Oakland Police Chief Anthony Batts described at the time as "tearing up the city."

Grant's mother, Wanda Johnson, had asked the judge to sentence Mehserle to the maximum 14 years in prison. She and four other family members who spoke at the sentencing hearing last year called him "a murderer."

The jury acquitted him of the more serious charges of second-degree murder and voluntary manslaughter.

Although his defense attorney argued for probation, Mehserle told Perry before sentencing that he would be willing to go to prison if the sentence made his city and family safer.

"I shot a man," he said. "I killed a man. It should not have happened."

A conviction for involuntary manslaughter normally carries a four-year sentence, but the judge had the option of adding an "enhancement" that could have made the sentence 14 years because a firearm was used in commission of a crime.

CNN's Greg Morrison contributed to this report.