NORTH ADAMS A city man is facing a series of drug charges after an extensive police investigation that ended with the execution of a no-knock warrant earlier this week.

Berkshire County prosecutors say Ryan Peterson, 30, dealt crack cocaine and heroin from his residence at 135 East Quincy St. Detectives from the North Adams Police Department built evidence for the case through three controlled purchases by two informants, stretching from 2017 to last week.

Peterson pleaded not guilty to the offenses Friday in Northern Berkshire District Court. The charges include carrying a firearm without a license, possessing a firearm after two convictions of drug crimes and possessing Class A and B drugs with the intent to distribute them.

According to information aired in court on Friday, police arrested Peterson on Wednesday in his bedroom with drugs, a digital scale and a loaded semiautomatic handgun nearby. He also had more than $3,500 in cash.

Peterson's attorney said the weapon did not belong to him and that the drugs pertained to his client's struggle with addiction.

Peterson has a long history of crime and interactions with law enforcement. According to the search warrant authorizing his arrest, Peterson has faced 44 adult arraignments and 16 juvenile ones, including a slew of drug charges and assault and battery on a police officer. The Massachusetts State Police Gang Unit also lists him as a validated member of multiple gangs in his hometown of New Bedford.

Peterson was already on bail in superior court for a separate case, but that bail has now been revoked pending a Sept. 30 review. Judge Paul Vrabel denied the Commonwealth's motion to hold Peterson as dangerous in the district court case, and has set bail at $10,000 cash.

Jack Lyons can be reached at Follow him on Twitter at @JackLyonsND.