Cody Austin Gaines and Blake Allen Sergel had plans to break into cars on New Year’s Day.

But what Gaines didn’t bet on was Sergel firing shots at Roberto Rodriguez, leaving the homeless veteran paralyzed near an overpass.

Rodriguez told a Cobb County judge he’d be dead if Gaines hadn’t stopped Sergel from firing more shots.

RELATED: The case against a man accused of killing an 87-year-old veteran takes an unexpected turn

“It is intolerable that any innocent victim — particularly one who risked his life serving our country —should have to pay for these teenagers’ utter disregard for human life,” Assistant District Attorney Theresa Schiefer said.

Gaines and Sergel, both 18 at the time of the shooting, were sentenced to eight and 20 years, respectively, Cobb County District Attorney spokeswoman Kim Isaza said in a news release.

The duo found Rodriguez, 57, sleeping under an overpass near the Canton Road Connector and I-75 and demanded money, Isaza said.

When Rodriguez told them he didn’t have any, Sergel shot him. Gaines pulled Sergel away and left, but not before Sergel grabbed Rodriguez’s cigarettes.

RELATED: Police say a driver’s actions got a veteran and firefighter killed as he went into work

A remorseful Gaines was eventually arrested several days later on a separate entering-auto charge and told police what happened the night of the shooting, Isaza said. He also told police he did not know Sergel was going to shoot Rodriguez.

Gaines pleaded guilty in August to robbery and aggravated assault charges.

Rodriguez said in court he believed Gaines saved his life by preventing Sergel from firing more shots and acknowledged if Gaines hadn’t come forward the case likely wouldn’t have been solved.

Teens who shot and paralyzed a veteran find out how long they’ll be paying the price Cobb County Sheriff's Office