Updated

Prince signed up for rehab to battle his pain pill addiction before his untimely death, according to reports Friday.

The 57-year-old “Purple Rain” singer knew he was hooked on Percocet before his death, possibly of an overdose, last week — so he entered an out-patient treatment program, the Minneapolis station KSTP 5 Eyewitness News reported.

The superstar attended the unnamed rehab center to move away from using medication prescribed for his severe hip pain, according to the station.He scored the opioid pills from multiple doctors, including “a personal friend,” TMZ reported.

Prince reportedly went to a local Walgreens pharmacy in Minneapolis to fill prescriptions four times the week before he died.

Law enforcement raided the pharmacy Friday, searching for evidence that could shed light on his tragic death, according to TMZ.

The star came close to fatally overdosing on Percocet six days before his death and was administered the opiate “save shot” Narcan, TMZ reported.

Officials have yet to release a cause of death.

Click here to read more in the New York Post.