A federal judge in Philadelphia sentenced rapper Beanie Sigel on Friday to three months in prison after authorities said he had given a false urine sample to probation officials.

Sigel, whose real name is Dwight Grant, had been serving a six-month term in a halfway house after violating terms of his supervised release. He told the judge he was an addict and had a relapse when he was sent to the halfway house.

Officials also say he tested positive five times this month for Xanax and Percocet.

In 2004, U.S. District Judge R. Barclay Surrick sentenced Sigel to a year in prison and two years of supervised release after Sigel pleaded guilty to weapons and drug charges. Sigel was acquitted in September 2005 of attempted-murder charges in connection with a shooting.