Beanie Sigel, the popular rapper who has been shadowed by his violent past, was wounded by gunfire during an attempted robbery early Thursday.

The holdup was attempted around 7 a.m. by five males traveling in two cars, but there was some confusion about where the shooting took place, police said.

Sigel's attorney, Fortunato Perri Jr., said the shooting appeared to be "a random act of violence."

The 32-year-old rapper spent a few hours at the Hospital of the University of Pennsylvania before leaving around 11:40 a.m. Thursday in a wheelchair, wearing a hospital gown, blue jeans and a blanket over his head. He also had a bloodstained towel on his right shoulder.

After getting into a black Mercedes, Sigel lowered the car window and said, "I got shot. I'm cool."

Moments later, he pulled his hospital gown aside and showed a bandage on his left shoulder to reporters. His left arm was in a sling and his left hand was bloody, The Philadelphia Inquirer reported on its Web site.

Sigel, born Dwight Grant, was released from federal prison in August after serving a year on a gun charge and was acquitted of attempted murder the following month. He was also briefly jailed in November for failure to pay child support.

His three albums — "The Truth" in 2000, "The Reason" in 2001 and last year's "The B. Coming" — each hit the top five on the Billboard album chart.