Beanie Sigel has been released from the hospital and is recovering after undergoing surgery.

According to TMZ, the Philadelphia rapper had a lung removed in a non-elective surgery. Doctors were not able to save the organ because it was riddled with bullet fragments.

Last month, the 40-year-old was shot in the stomach outside his brother-in-law’s New Jersey home as he returned from taking his kids to school. Police believe Sigel was not the target and that the shooter was aiming for the man standing next to him.

Neef of hip-hop duo Young Gunz posted a photo of Sigel leaving a hospital in Atlantic City earlier this week.

In August, Sigel was released to a Philadelphia halfway house after serving a two-year sentence in federal prison for tax evasion. He has been on home confinement since September 25.

He will spend the next 90 days in recovery at Bacharach Institute for Rehabilitation in Pomona, NJ. Meanwhile, no arrests have been made in the shooting.