Five people, caught in separate incidents, have admitted in court in the past week to illegally possessing weapons in Buffalo.

“Five potential shooters off the streets,” Erie County District Attorney Frank A. Sedita III said. “If they had chosen the mayor’s gun buy-back program, they could have spent a night on the town. Now they’ll spend the next 3½ to 15 years in state prison. They chose unwisely.”

The five Buffalo residents face maximum prison sentences of 15 years after pleading guilty to second-degree criminal possession of a weapon, according to the Erie County District Attorney’s Office.

• Kenneth Virges, 43, of Nevada Avenue, admitted possessing a loaded, stolen 9mm pistol that police found in his car after they responded to a call on May 13, 2012 about a man smoking marijuana in his car.

Virges also pleaded guilty to criminal possession of marijuana. The conviction is his fourth felony conviction since 1991. He is scheduled to be sentenced June 18 by Erie County Judge Michael D’Amico.

• Daniel Burnett, 23, of Grape Street, admitted possessing a .22-caliber revolver in his pants pocket. Police officers arrested Burnett on Oct. 5, 2012 on Rodgers Street while they were on the lookout for a person who reportedly brandished a gun and threatened a woman about 10 minutes earlier. Burnett is scheduled to be sentenced on May 22 by State Supreme Court Justice Penny M. Wolfgang.

• Terence Williams, 29, of Crowley Avenue, admitted possessing a loaded 9mm pistol in his vehicle. Williams, considered a person of interest in an assault case and suspected of dealing heroin in the Riverside section of the city, was found at a gas station on Ontario and Skillen streets on April 26, 2012, according to the District Attorney’s Office. Williams tried to get away by backing his vehicle into a police car. Police also found heroin and marijuana inside the vehicle. Williams posted bail but then fled. The U.S. Marshal’s Fugitive Task Force found and returned him in September. Williams is scheduled to be sentenced on May 22 by Wolfgang.

• Steven J. Buchanan, 19, of Walden Avenue, admitted possessing a .380 automatic pistol. Police spotted Buchanan riding his bicycle against traffic on July 18, 2012 and were going to write him a summons for the infraction. He tried to get away on foot, and during the chase, police said he threw an object. Buchanan said he tossed a fake gun. Police could not find it and later released him. Later that evening, a police officer responded to a 911 call about a discarded gun in a yard. Officers realized the gun was found in an area where police had chased Buchanan, so they questioned him again, during which time he admitted possessing the pistol. Buchanan is scheduled to be sentenced on June 11 by Erie County Judge Sheila A. DiTullio.

• Jose Mendoza, 23, of Bird Avenue, admitted possessing a .38-caliber revolver on Aug. 26, 2012. Police received information that Mendoza was carrying a weapon in the vicinity of Perkins Place and Herkimer Street. When police showed up, he fled and threw a bag to the ground, according to the District Attorney’s Office. An officer recovered the bag, and Mendoza was arrested on a warrant the next month. Testing revealed Mendoza’s DNA was on the weapon. He is scheduled to be sentenced May 31 by State Supreme Court Justice Russell P. Buscaglia.

In all five cases, the charges they pleaded guilty to are the highest they could have been convicted of had they gone to trial, according to the District Attorney’s Office.

Sedita cited the work of prosecutors John P. Gerken Jr., Sara Ogden, Brian Langenfeld and Rene Juarez, as well as the efforts of police officers.

In arresting Virges, police officers Joseph Doxbeck and Charmaine Grabowski displayed “quick response and keen instincts,” which resulted in a conviction and mandatory incarceration of an armed three-time prior felon, Sedita said.

Sedita also praised police officers for their work investigating Buchanan.

“Because of their presence of mind and dogged determination, another gun-toting hoodlum will face a mandatory term of imprisonment,” Sedita said.