A man who pleaded guilty to possession of an unlicensed firearm received a sentence of nine years instead of the mandatory seven years because it was his second similar offense.

Kylan Junior Hunter, 33, was sentenced last week by Justice Charles Quin after admitting possession of a handgun loaded with 10 rounds of ammunition on the night of April 23, 2016.

Justice Quin, who summarized the offending, said two police officers were on patrol along West Bay Road near the parking lot of Calico Jack’s when they saw Mr. Hunter and a group of people. The officers saw him remove an object from his waistband and hand it to a woman, who walked away.

One officer pursued the woman and the other followed Mr. Hunter. The officer pursuing the woman recovered the pistol from her. Both officers said that was the object they saw Mr. Hunter hand her.

The woman, later identified as Juliette Latham, said to the police officer, “You saw when Kylan put this on me, right? Am I going to jail?” Then she called out to Mr. Hunter, “You, Kylan, you have to take this – I’m not going to prison for you guys.”

Justice Quin said Mr. Hunter’s offense was aggravated by the fact that he had a loaded gun in a public place at night.

He noted that Mr. Hunter denied ownership of the gun even after his DNA was found on it and he initially pleaded not guilty.

Mr. Hunter had 21 previous convictions, including one for possession of an unlicensed firearm. A jury had found him guilty in 2007 of that offense, which had occurred in 2006.

Justice Quin said Mr. Hunter’s previous convictions had shown complete disregard for authority.

The appropriate sentence would have been 12 years, but the judge was prepared to give him a 25 percent discount, bringing it down to nine years.

Ms. Latham, 29, pleaded guilty on a previous occasion and received a sentence of 10 months, suspended, after spending some time in custody.