Rapper Soulja Boy was charged Monday on suspicion of illegally possessing firearms including a handgun at one time stolen from the Huntington Beach Police Department, according to the Los Angeles County District Attorney’s Office.

The 25-year-old rapper, whose real name is DeAndre Cortez Way, pleaded not guilty on Monday in Los Angeles County Superior Court.

The Studio City resident faces up to four years in prison if convicted of two felony weapons-possession counts, and a misdemeanor count of receiving stolen property.

Way was arrested at his home on Dec. 15 after police found him in possession of a Mini Draco AR-15, and a Glock 21 .45-caliber handgun that had been reported stolen from a Huntington Beach police vehicle, Los Angeles County Deputy District Attorney Michael Morse said.

The Glock was taken from the trunk of an officer’s unmarked vehicle parked outside of his Long Beach home in September 2015, Huntington Beach Police Chief Robert Handy said Monday. Handy declined to identify the officer or comment further on the burglary because of the ongoing investigation involving Way.

Although officers are permitted to take weapons home, they must keep them secure or face consequences, Handy said. The loss or theft of a Police Department-issued firearm usually results in discipline against the officer unless there are extenuating circumstances.

“There are very few circumstances where losing a weapon would be OK,” Handy said.

Law enforcement officers must lock up their guns left in unattended vehicles or face fines of $1,000, under a bill signed in September by Gov. Jerry Brown.

The new law – which had been in the works for months and puts officers in the same camp as civilians in storing weapons – came a day after a Register investigation found that at least 329 police firearms were reported lost or stolen from Southern California law-enforcement agencies during the past five years.

The gun in the Way case was among the weapons reported in the Register investigation.

On Dec. 18, 2014, Way was sentenced to two years of probation after a conviction of carrying a loaded firearm in a public place, according to The Associated Press.

He is best known for his September 2007 debut single, Crank That (Soulja Boy), that peaked at No. 1 on the U.S. Billboard Hot 100.

Staff Writer Tony Saavedra contributed to this report.

Contact the writer: 714-796-7767 sschwebke@scng.com Twitter: @thechalkoutline