BUFFALO, N.Y. (WIVB) — A Buffalo man could spend 40 years behind bars after pleading guilty to attempted murder and criminal possession of a weapon in separate incidents.

David J. Smith, 20, of Buffalo, was stopped on March 24, 2022, around 6:35 p.m. by U.S. Custom and Border Protection officers for driving the wrong way on Peace Place near the Peace Bridge.

While speaking with Smith, Border Patrol agents spotted a handgun sitting in plain view on the floor of the driver’s side backseat, according to the Erie County District Attorney’s Office. Investigators recovered the loaded, illegal weapon.

Smith was arraigned in Buffalo City Court on one count of second-degree criminal possession of a weapon on March 25. He posted $10,000 in bail and was released.

On May 31, the 20-year-old fired several shots into a store on the 300 block of Hopkins Street in Buffalo around 8:11 a.m. with intent to kill his target, the DA’s Office said.

The victim was rushed to Erie County Medical Center for lower leg and foot treatment.

Smith was later arrested.

On June 2, he was arraigned on one count of second-degree attempted murder, one count of second-degree assault and one count of second-degree criminal possession of a weapon.

Smith pleaded guilty to the highest charges in the indictment against him. He admitted to the attempted murder charge and criminal possession of a weapon charge.

The 20-year-old will be back in front of a judge for sentencing on Jan. 5 at 9:30 a.m.

Patrick Ryan is an award-winning reporter who has been part of the News 4 team since 2020. See more of his work here and follow him on Twitter.

New on WIVB.com