(CNN) In an emotional court hearing, a former Washington, D.C., police officer was sentenced to a year in federal prison Wednesday for illegally dealing guns, two of which were linked to deaths.

"I just want to take a moment to apologize to everyone in the courtroom," Richard Wince, 51, said through tears before his sentencing in federal court in Richmond, Virginia. "I understand I made a mistake, and mistakes have consequences."

One of the guns Wince sold was an AK-47 used by a troubled former Marine reservist to kill himself, according to court records. Another was used in a homicide in Washington, authorities said in court on Wednesday. A third gun was used in a robbery.

Wince told US District Court Judge M. Hannah Lauck that he got caught up in conduct that he said became "reckless."

But he said his crime was inconsistent with his 30-plus years of service in the military and law enforcement.

"It doesn't define the person I am or have been," Wince said. His wife of 28 years wiped away tears as he spoke.

Lauck told Wince she could see he had genuine regret. But she also pointed to the fact that he had continued selling guns even after being warned by agents of the Bureau of Alcohol, Tobacco, Firearms and Explosives that one of his weapons ended up in the possession of a convicted felon.

"You were on notice," the judge said pointedly.

Lauck added that she found the number of weapons involved, and the circumstances under which some were recovered, "extremely troubling."

She told Wince if she could sentence him to look into the eyes of the family of suicide victim Isaiah Janes, that's what she would do.

Janes, 29, was barred from possessing weapons as a result of his stay in a psychiatric facility in June 2016, according to court records. After his release, Janes attempted to buy a 12-gauge shotgun from a Dick's Sporting Goods in Rhode Island. But when the clerk ran a background check and learned that he was what's known as a prohibited possessor, the sale was denied.

Janes bought the gun from Wince in a parking lot later that month, according to court records. The officer did not conduct a background check. Janes killed himself with the gun about two weeks later.

When Wince was first visited by the ATF in October 2015 about the gun that turned up in the possession of the felon, he told agents he was a hobbyist and only occasionally bought and sold firearms over the internet.

JUST WATCHED Flaws in gun background check system cost lives Replay More Videos ... MUST WATCH Flaws in gun background check system cost lives 01:58

As such, he would not have been required to conduct background checks on buyers or keep records on guns he bought and sold.

Lauck seemed dismissive of the notion Wince was a hobbyist, citing the military-style weapon the officer sold Janes shortly before he killed himself.

"I don't know what kind of hobby involves an AK-47," the judge said.

"That weapon is for mass murder," she added. "It's not for hunting."

At various points in the hearing, the prosecutor, Wince's defense attorney and Lauck each expressed frustration with the federal statute that governs unlicensed gun dealing. The statute does not provide a specific number of weapons sold over a period of time that would require someone to obtain a license. Wince admitted selling up to two dozen firearms after being contacted by the ATF.

Wince's defense attorney, Elliott Park, called the law "unconstitutionally vague."

Assistant U.S. Attorney Peter S. Duffey, who prosecuted Wince, told Hauck he wasn't a fan of the law either.

"I don't understand why they couldn't set a number," he said.

But Duffey also said Wince's background as a law enforcement veteran should have told him what he was doing was wrong.

"Of all people, Mr. Wince should have known better," Duffey said.