Updated

A Canadian diplomat's teenage son will attend a military-style boot camp and serve up to eight years' probation under a plea agreement approved Friday that spares him a lengthy prison sentence for his role in a drug-related shootout that killed his older brother and another teenager.

Miami-Dade Circuit Judge Teresa Mary Pooler accepted the deal worked out by prosecutor Marie Mato and Curt Obront, the attorney for 15-year-old Marc Wabafiyebazu. Wabafiyebazu's mother is Roxanne Dube, who said she is stepping down as Canada's consul general in Miami but will continue here in another diplomatic role.

"I am so grateful," Dube said after the court hearing. "I get my son back. I have every intention to make Marc my first priority."

Germano Wabafiyebazu, Marc's father, told The Associated Press from Ottawa, Canada that he was very pleased with the plea deal.

"It's a big relief for us," he said.

On March 30 last year, police say Wabafiyebazu was outside a house -- possibly serving as a lookout -- when his 17-year-old brother Jean and 17-year-old Joshua Wright shot each other to death inside. The brothers, driving their mother's BMW with diplomatic license plates, were attempting to rob marijuana dealers when the gunfire erupted, authorities say.

Wabafiyebazu was indicted as an adult with first-degree felony murder and other serious charges that carried a potential life prison sentence. Under Friday's agreement, the charges were reduced to first-degree felony murder, attempted armed robbery and aggravated battery that carry a combined 60-year potential prison term.

Felony murder means a person took part in a crime that involved a person's killing, but was not directly responsible for the slaying itself.

In addition to boot camp, which begins Feb. 25 and will last about nine months, Wabafiyebazu must serve about two years of house arrest with an electronic ankle monitor followed by eight years of probation in the U.S. If he violates any of several probation conditions, Pooler could still send him to prison -- but if he does well, she may end probation early.

Among the conditions: he must complete his high school education, submit to random drug testing and possess no firearms. The boot camp program includes behavior courses, drug treatment, education and job training.

"You will do what you are supposed to do?" Pooler asked the teenager.

"Yes I will, your honor," he replied.

Ed Griffith, a spokesman for the Miami-State State Attorney's Office, said the plea deal is similar to those worked out for two other young people who were present when the two teenagers were shot.

"We think that this was an appropriate way to handle this sad and tragic situation," Griffith told reporters. "This gives him a chance to straighten out his life."

If Wabafiyebazu completes all plea agreement terms successfully, a judge could issue a ruling wiping any felony convictions from his record, Pooler said.

"If you do it, it will be a major accomplishment because a lot of people can't make it," Pooler told Wabafiyebazu.