A judge on Friday approved an agreement by lawyers to destroy the assault-style rifle that Kyle Rittenhouse used to kill two people and wound a third during a 2020 street protest in Wisconsin.

Assistant District Attorney Thomas Binger said the state crime lab would destroy the gun, probably in April. Judge Bruce Schroeder, the Kenosha County judge who presided over Rittenhouse’s trial, approved the agreement. Rittenhouse was not in court for Friday’s hearing.

The judge also ordered that Rittenhouse’s $2 million bail be divided among his attorney, a foundation that solicited donations for his defense and actor Ricky Schroder, who donated to the defense fund.

Rittenhouse shot the men during the protest in Kenosha in 2020. He killed Anthony Huber and Joseph Rosenbaum and wounded Gaige Grosskreutz in the arm. Rittenhouse argued he fired in self-defense after each of the men attacked him. A jury last year acquitted him of multiple charges, including homicide.

Rittenhouse’s attorney, Mark Richards, filed a motion Jan. 19 asking prosecutors to return Rittenhouse’s rifle, his ammunition, his face mask and other clothing he was wearing the night of the shooting to him. Richards and David Hancock, a spokesman for Rittenhouse, said last week that Rittenhouse, who is now 19, wanted to destroy the rifle and throw the rest of the items away so nothing can be used as a political symbol or trophy celebrating the shootings.

“We didn’t think anyone should profit from it,” Richards told reporters after the hearing. Asked if anyone had reached out about purchasing the gun, Richards responded: “Lots of people.” He didn’t elaborate.

Destruction of the gun will be recorded as part of the agreement that was approved Friday. The rest of Rittenhouse’s property has already been returned to him, Binger told the judge.

Conservatives across the nation have praised Rittenhouse, saying he was defending Kenosha from far-left militants. Liberals have painted him as a trigger-happy vigilante.

The judge on Friday also ordered county officials to return Rittenhouse’s $2 million bail. His attorneys raised the money through donations from conservatives across the country.

The judge approved an agreement that calls for splitting the money between Richards’ law firm and the #Fightback Foundation. Attorneys Lin Wood and John Pierce, who were representing Rittenhouse in the early days of case, formed the foundation to raise money for him. The agreement also calls for sending $150,000 to Schroder, the former star of the 1980s television series “Silver Spoons.”

The Patent and Trademark Hedge Fund Trust filed a motion Thursday laying claim to the $2 million. The fund’s co-trustee, Mariel Johnson, argued in an affidavit that the fund had given as much as $2.5 million to Pierce to finance his cases and has been trying to recoup the money after Pierce’s law firm dissolved. Johnson noted that the fund gave him $300,000 to put toward Rittenhouse’s bail and is entitled to every dollar Pierce used to cover Rittenhouse’s bond.

Schroeder denied the motion, ruling that the fund’s attorneys aren’t licensed to practice in Wisconsin.

Richards declined to say after the hearing how much of the bond money would go to Rittenhouse. He didn’t immediately respond to a follow-up email message.

Rittenhouse’s case dates back to August 2020, when a white Kenosha police officer shot Jacob Blake, a Black man, during a domestic disturbance. The shooting left Blake paralyzed from the waist down and sparked several nights of protests.

The demonstrations turned chaotic at times, with people burning buildings. Rittenhouse and his friend, Dominick Black, joined a group of militia members to protect a used car lot on the night of Aug. 25, 2020.

Rittenhouse, who was 17 at time and living in Antioch, Illinois, was armed with an AR-15-style rifle that Black had purchased for him earlier that year because he was too young to buy a firearm under Wisconsin law.

According to the motion, Black had agreed that the rifle would become Rittenhouse’s property on his 18th birthday, Jan. 3, 2021.

Bystander and surveillance video shows that just before midnight Rosenbaum chased Rittenhouse down and Rittenhouse shot him as he closed in on him. He shot Huber after Huber swung a skateboard at his head and Grosskreutz after Grosskreutz ran up to him holding a pistol. Everyone involved in the shooting was white.

Black pleaded no contest to two citations earlier this month for contributing to the delinquency of a minor in exchange for prosecutors dropping two felony charges of intent to sell a dangerous weapon to a person younger than 18.