(CNN) As a Washington, DC, police officer, Richard Wince knew firsthand about the dangers of black market gun sales and the inherent risk of weapons ending up in the wrong hands.

But that didn't stop him from illegally dealing firearms while off-duty. Prosecutors say he supplied weapons to people who couldn't buy them legally, including a troubled former Marine reservist deemed "mentally incompetent."

Wince sold the 29-year-old former Marine an AK-47 that he used to kill himself about two weeks later, according to court documents reviewed by CNN. Another weapon Wince sold "was used in a murder," the documents state. Authorities declined to provide details about the slaying.

Wince told federal authorities he was "addicted" to websites devoted to buying, selling and trading guns and sold up to two dozen firearms even after he had been questioned by agents from the Bureau of Alcohol, Tobacco, Firearms and Explosives over how one of his guns ended up in the hands of a convicted felon, according to court documents.

Former Washington, DC, police officer Richard Wince has pleaded guilty to dealing firearms without a license.

Peter Newsham, chief of Washington's Metropolitan Police Department, where Wince worked until earlier this year, called his former officer's crimes "a disgrace."

"It's embarrassing for us to have a member of this agency out there illegally selling firearms," Newsham said. "Because people will attribute that behavior to every single one of us who wears this uniform."

The case against Wince offers a glimpse into the problem of unregulated firearms sales in America at a time of fierce national debate over gun control. Law enforcement officials say unlicensed dealers such as Wince provide a steady flow of weapons to criminals who can't buy them legally.

Wince, 51, pleaded guilty to dealing firearms without a license earlier this year. He is scheduled to be sentenced in federal court Wednesday in Richmond, Virginia.

He declined comment for this article.

In a court filing, Wince's attorney described his client as a "devoted husband and father" with "a long history of service to his country." Wince served as a military police officer in the US Navy, as a deputy with the Chesterfield County, Virginia, sheriff's department and, until January, as an officer with Washington's Metropolitan Police Department, according to court records. In all, he spent "more than thirty years" in law enforcement, Wince's filing states.

Wince told federal agents he was "addicted" to websites devoted to the firearms trade.

Wince first came to the attention of the ATF in 2015, when agents discovered that a .38 revolver he once owned turned up in the possession of a "multi-convicted felon" named Darryl Freeman.

The agents interviewed Wince, who told them he collected guns as a hobby and would occasionally buy and sell them over the internet.

As a hobbyist engaged in occasional sales, he would not have been required under federal law to perform background checks on buyers and maintain paperwork on the guns he bought and sold -- as licensed dealers are required to do. Wince told the agents he could not find any records relating to the sale of the .38.

During their interview, court records show, the agents advised Wince that it was a violation of federal law to repeatedly sell guns for a profit without having a license.

The matter might have ended there, but Wince's name would come up again nine months later, resulting in renewed scrutiny of his status in the firearms trade.

That happened when sheriff's deputies in rural Rockingham County, Virginia, were called to check on the well-being of a man who was renting a cabin in the area.

Deputies found a badly decomposed body in the woods. There was an AK-47 and a suicide note on the ground nearby.

There were also several pieces of identification bearing the name of Isaiah Janes.

Former US Marine reservist Isaiah Janes, who was prohibited from purchasing a weapon due to mental instability, bought a gun from a Washington, DC, police officer and used it to kill himself, according to court records.

Investigators spoke to Janes' mother and learned that he had been abusing alcohol and marijuana and had become delusional.

He was involuntarily committed to a psychiatric facility in San Diego a month earlier. As a result, he was prohibited from possessing a weapon.

When Janes returned to his family's home in Rhode Island, he attempted to buy a 12-gauge shotgun at a Dick's Sporting Goods store. But when the clerk conducted a required background check, Janes was identified as a prohibited possessor. The clerk refused the sale.

The law worked.

An ATF agent later called Janes on his cell phone, inquiring about the attempted purchase. Janes told him he didn't realize the incident in San Diego, which he attributed to a misunderstanding with a roommate, prevented him from possessing a gun. He assured the agent he did not have one.

How, then, did Janes get his hands on an AK-47?

When agents traced the weapon, it came back to Wince. The officer had purchased it online, then picked it up at the Dominion Shooting Range on June 21, 2016, court records show.

The GPS in Janes' rental car showed that he visited the same gun range four days later.

Special Agent Adam J. Ulery began searching websites devoted to gun sales and discovered more than 200 posts from users regarding transactions with the profile name "rwince," according to court documents. The phone number for the "rwince" profile matched the number Wince gave agents during their interview months earlier.

Ulery monitored Wince's account and noted that he posted several handguns, an AR-15 rifle and an AK-47 for sale. Wince's post for the AK-47 noted that it came with three magazines and that he would "throw in some ammo," according to court records.

Information obtained through a subpoena of an online gun trading site showed that Wince had made more than 400 posts related to firearms from June 2013 through April of last year.

The ATF then set up a sting in which they used an undercover agent in an attempt to buy a gun from Wince.

The agent texted Wince and worked out a deal in which he agreed to pay $375 for a Smith & Wesson 9mm pistol -- a gun Wince had purchased at a police supply shop just a week earlier.

They met in the parking lot of gun store outside Richmond, Virginia. During the meeting, which was secretly recorded, "Wince never asked the undercover agent for any form of identification," court records state.

The agent told Wince he didn't mind a higher price for the gun since he didn't have to fill out paperwork.

Two days later, agents went to Wince's home outside Richmond. He told them he was "addicted" to spending time on two different websites devoted to the buying, selling and trading of guns, the affidavit states. He told the agents he'd made over 1,300 posts on one of the sites.

He told agents he takes photos of the identification of everyone to whom he sells.

They asked him about the AK-47 that turned up next to Janes' body.

"Wince advised that he sold it to a male who was in the military," the affidavit states, but could not provide any further detail about him.

Prosecutors said Wince sold the AK-47 to Janes in a parking lot and did not conduct a background check.

Janes tried to buy a 12-gauge shotgun from a Dick's Sporting Goods, but was turned down after a background check revealed he was prohibited from possessing weapons, according to court records.

Janes' father, Charles, called Wince's actions "abhorrent" because they "put at risk the lives of other human beings."

"It's doubly abhorrent because he was a law enforcement officer," the elder Janes told CNN.

As part of his plea, Wince admitted to illegally selling "at least eight, but no more than 24 firearms" following the initial contact by the ATF. Federal sentencing guidelines call for Wince to receive a prison term of one year to 18 months.

Wince's attorney argued for a more lenient sentence of probation and home confinement, citing his service in the Navy and law enforcement.

Assistant US Attorney Peter S. Duffey, who is prosecuting the case, wrote that any credit Wince was entitled to for his service was erased by his conduct.

"The very nature and consequences of his actions made the defendant and his law enforcement colleagues less safe in the performance of their duties," he wrote.