A Cobb County judge sentenced a Marietta man to 50 years in prison Friday for shooting at people driving in their cars in order to show loyalty to his gang.

Johannes Alexander Lopez, 27, was sentenced to 100 years, with half of that to be served in custody and the rest on probation, Cobb County District Attorney’s Office spokeswoman Kim Isaza said.

Cobb County District Attorney Vic Reynolds said Lopez was a member of the criminal street gang SUR 13 and was involved in two separate shootings at vehicles carrying innocent people in September 2013,. He allegedly shot at them because their cars were the same color as of one of SUR 13's rival gangs. SUR 13's color is blue and the color of its rival gang is red.

In the first incident, two unidentified people from Lopez’s vehicle shot at a red car driven by a pregnant woman and her husband on Bankhead Highway. Later that day, on Hicks Road, a shotgun was fired from Lopez’s Ford Explorer at another red car.

None of the four people in the two vehicles that were shot at was hurt. Gun ballistics was matched to one of the crime scenes and Lopez was arrested.

Gang experts testified Lopez has an extensive criminal history related to his gang membership, authorities said. He had been released from prison in May 2013 after an earlier felony conviction in Cobb. The experts testified that when a gang member gets out of prison, he is expected to reestablish himself through acts of violence.

Lopez was charged with violation of the Street Gang Terrorism and Prevention Act, aggravated assault, firearms possession, and criminal damage to property in the first degree. He was convicted Thursday.