After more than eight hours of deliberation, a jury found Joshua Joyner guilty on charges of capital murder for killing 19-year-old Albert Nelson.

Joyner was sentenced to life in prison and will serve 40 years before he's eligible for parole.

Prosecutors made the successful case that on July 24, 2015, Joyner arranged a robbery with four of his friends. They planned to meet 19-year-old Albert Nelson at Elolf Elementary School in Converse, telling him they wanted to purchase $75 of marijuana.

Joyner apparently had a beef with Nelson, fueling the fake drug deal.

Prosecutors say that the group didn't arrive with $75. They instead planned to steal the drugs.

When they met up, investigators say that an argument started between Joyner and Nelson. They say Nelson pointed a gun at Joyner, and that's when Joyner got out his own gun and pulled the trigger.

"When they were in the process of robbing Albert Nelson and Albert Nelson looked at him hard, he got up, he walked up to his vehicle feet away from Albert Nelson and he shot him. If that's not an intent to kill, we don't know what is," prosecutor Jacqueline Valdes said.

Prosecutors told jurors that the gun Joyner used was stolen and loaded with 29 live rounds of ammunition.

RELATED: Prosecutors present weapon, conflicting testimony in teen murder trial

Investigators say they found traces of Joyner's blood on a gun later recovered in a ditch by the school, wrapped in a T-shirt.

"[Joyner] admits that he continued to approach the victim's vehicle although the victim had a pistol pointed at him," Valdes said to the jury. "He admits that he got shot and he admits that he ran through the woods and through the trees and back into the ditch."

Defense Attorney Mario A. Trevino posed the question to jurors: While Joyner's blood might have been on the gun, why didn't prosecutors run tests for fingerprints?

"Because it wasn't in the course of attempting to commit a robbery. There was no interest in that, according to their theory in the case. It's just, 'Set him up. When he comes up, BOOM!' A murder. It shouldn't have even been charged as capital murder. That is what is commonly known as overcharging," Trevino said in court.

The defense didn't call any witnesses, but reiterated the inconsistency of witness testimonies by Joyner's four accomplices.

RELATED: Prosecutors follow trail of blood in fourth day of teen murder trial

Trevino said that the boys communicated in advance to align their stories and that they lied to police so they wouldn't face charges.

"Mr. Nelson was pending an aggravated assault with a deadly weapon. His mom thought he was unjustly charged, too," Trevino told the jury. "This is how they handle those kinds of cases. They don't put the time in that they need to to treat these guys with equal respect."

Joyner was also shot during the altercation, but it's still unclear how.