The robber forced his way into the rapper's home and was holding his wife at gunpoint, according to their attorney.

HOUSTON — Grammy-nominated rapper -- and Houston icon -- Bun B shot a robber at his home Tuesday night, Houston police say.

Bun B, whose real name is Bernard Freeman, fired at the masked robber, who had pulled a gun on his wife when she answered the door around 5:45 p.m., police said.

The robber -- later identified as Demonte Alif Jackson -- forced his way inside and held Queen Freeman at gunpoint, according to attorney Charles Adams.

She begged the suspect not to kill her and offered him the keys to her car.

"Her fear was that this was someone trying to target her husband, so she gave him the car keys and all the possessions she had," Adams said.

Bun B heard the disturbance from upstairs, grabbed his gun and confronted Jackson, who was sitting inside his wife's Audi.

They exchanged gunfire and the suspect jumped out of the Audi and took off.

Police say Bun B chased him and was able to pull his mask off, but the robber got away.

Jackson was later arrested at a Pearland hospital, police said. He had been shot in his left shoulder.

Neither Bun B nor his wife were hurt in the altercation but both are shaken up.

"I’ve had messages from the Middle East and Europe, everyone is concerned about Bun and Queen. Although they’re physically fine, the wounds, emotional wounds, I can’t speak to how long they’ll take to heal," Adams told KHOU. "But it is really a story of two people that truly love each other and risked their lives to save each other. And I just thank God that both of them are okay."

Jackson was charged with two counts of aggravated robbery with a deadly weapon and one count of burglary. His bond is set at $120,000.