ALBANY, N.Y. (AP) - A man wounded 16 years ago in a mistaken identity shooting can’t sue the Ohio gun dealer who sold the weapon used in the crime, according to a decision by New York state’s highest court.

The Court of Appeals ruled 4-3 Thursday that Charles Brown, of the Dayton, Ohio, area, can’t be sued in New York by Daniel Williams because the handgun was sold in Ohio and Brown had no control over where the weapon eventually ended up.

“It’s been a long time coming,” Scott Braum, Brown’s attorney, said Friday about the decision, noting that the lawsuit was filed in 2005. “The case’s main significance was that this was the lawful sale of a lawful product.”

According to court documents, Brown, a licensed firearms dealer, sold 182 handguns at a gun show in Dayton to another Ohio man and his associates over several months in 2000. That man, James Bostic, then took some of the weapons to Buffalo, where he sold one to a gang member.

The gang member, thinking the then-16-year-old Williams was in a rival gang, used the 9 mm Hi-Point handgun to shoot the teen as he played basketball in front of a Buffalo home in 2003. Williams, who had aspirations of playing in college, survived but was left with a serious stomach wound, according to court documents.

Bostic later pleaded guilty to running an illegal gun trafficking ring in western New York.

The Court of Appeals ruling upheld a lower court’s decision that dismissed the lawsuit on the grounds that Williams failed to prove Brown should have known the guns would end up in New York judging by the conversations he had with Bostic.

Those talks included Bostic saying he planned to open a gun shop in Ohio and “wouldn’t mind having a shop in Buffalo.” Bostic never followed through with those plans.

Brown, licensed to sell firearms only in Ohio and only to Ohio residents, filed the required gun sales documents with local and federal law enforcement agencies, and Bostic passed an FBI background check, according to court documents.

“Despite Bostic’s stated aspiration to open a gun shop in Buffalo, the record is devoid of evidence supporting plaintiffs’ theory that, merely by selling handguns to Bostic, Brown intended to serve the New York market,” Chief Judge Janet DiFiore wrote in her majority opinion.

Williams was represented by Jonathan Lowy, the chief counsel for the Brady Center to Prevent Gun Violence. The group’s spokesman, Max Samis, said it is disappointed by the ruling and is considering next steps.

“In the meantime, an active suit still exists against the firearm distributor and manufacturer, and we look forward to pursuing the case against the remaining defendants,” he said.

Williams‘ lawsuit also names Beemiller Inc., an Ohio firearms manufacturer, and MKS Supply Inc., a wholesale firearms distributor in Ohio. Thursday’s decision doesn’t dismiss his lawsuit against the companies.