CALDWELL – A Nampa man is headed to prison for his role in a Walmart parking lot shootout that injured a 10-year-old girl last year.

Mario Garza, 20, was sentenced Tuesday to 17 years in prison, with six years before he will become eligible for parole.

Prosecutors say Garza and rival gang member Ezri Garcia were aiming at each other when they both opened fire in the crowded parking lot June 29, 2016. Garcia was sentenced to 19 years in prison in February.

Garza is not accused of firing the shot that struck the 10-year-old at a nearby Chevron station; that round came from Garcia’s .380, investigators say.

MORE: 'I hope you rot in jail:' Gang member sentenced for shooting 10-year-old

But Prosecutor Ellie Somoza said Garza was just as responsible for her injuries as the other shooter.

“Without this defendant’s actions, none of this would have happened that night,” she said.

Somoza said the men had quarreled over Facebook days before.

“The next time you see me, you better have a gun, and you better use it,” Garza wrote in one of the messages, according to prosecutors.

On the night of the shooting, as the Walmart parking lot filled with families who had gathered to watch the fireworks from the nearby God and Country Festival, Garza spotted Garcia walking through the crosswalk in front of his car.

RELATED: Only on 7: 10-year-old girl healing after hit by stray bullet

Surveillance video from the outside of the Walmart shows Garcia quarrel, then fistfight with a 16-year-old passenger in Garza’s car. Garcia then took off running down one of the aisles of the parking lot.

Garza followed him, pulling in ahead to cut him off. Somoza said Garza got out of his car and hit the other man with a handgun, opening a large gash on his head.

Garcia pulled his own gun, and both men started shooting.

Ten-year-old Chloe was playing in the grass with her sisters when one of the bullets struck her in the shoulder, dropping her.

Others in the lot scrambled behind cars or dove to the ground, grabbing for their own children.

Somoza said it was just “dumb luck” that more people weren’t hurt or even killed.

“Easily, the bullets that were fired by Mario Garza could have struck any number of those people,” she said.

The girl was rushed to a local hospital, but surgeons were unable to remove the bullet lodged in her shoulder. Her family says she is still unable to lift her right arm above her head.

In a letter read aloud in court by the victim’s mother, Chloe wrote that she hoped Garza and Garcia “get the most time in jail possible for your crimes.”

“The day you shot me, my life changed because you were selfish,” the child wrote.

PREVIOUS: More arrests in gang-related shooting case

Chloe’s mother also showed Garza a photo of her smiling brunette daughter, then held up another of her lying in a hospital bed, covered in blood.

“This is my daughter Chloe, and this is what your actions did to her,” she told the defendant.

Somoza asked the judge to hand down the maximum sentence allowed under the plea deal – 18 years, with seven fixed – to send a message to other gang members that “senseless violence” would not be tolerated.

She also noted that Garza was on probation for misdemeanors at the time of the shooting, and had multiple chances to disengage from Garcia or let him run away without escalating the fight.

“I think it’s fair to characterize him…. as a multiple offender, professional criminal,” she said.

But defense attorney Aaron Bazzoli said that characterization was not fair.

“Mario doesn’t exist in a vacuum as a gangbanger,” he told the judge.

Bazzoli acknowledged his client had admitted to riot with a gang enhancement and aggravated assault with a weapons enhancement – a plea his Garza later tried to withdraw.

But he noted that Garza had no felonies on his record, and urged the judge to take his young age into consideration.

The prison sentence requested by the prosecution could put Garza behind bars until he was 38, he said, arguing that five years behind bars would be sufficient punishment.

“That’s a good portion of a person’s life,” he said. “That’s when you’re building your life, building a home.”

But Judge Davis VanderVelde opted to hand down the 17 year sentence, telling Garza he believed he was a “significant risk to the community.”

“You showed a complete disregard for the safety of members of the community,” he said. “There were hundreds of people present when you decided to have a gunfight with a rival gang member.”