Rapper Bun B was not injured after exchanging gunshots with a man who allegedly forced his way into his Houston home, held his wife at gunpoint and tried to steal his car.

Charles Adams, Bun B's lawyer said the rapper (real name: Bernard Freeman) was protecting his home and wife, Queenie Freeman, when he shot the armed intruder in the shoulder Tuesday night.

"Bun was courageous in the efforts to protect his wife, his wife was courageous in her efforts to protect him," Adams tells USA TODAY. "It was a horrible and beautiful story at the same time."

Houston police told USA TODAY that Bun B, 46 – one half of the rap duo UGK – was upstairs in his home when the armed man identified as DeMonte Jackson, 20, forced his way in the door.

Queenie Freeman heard the doorbell and opened the door thinking it was an Amazon delivery person.

"When she did open the door, a masked suspect forced his way inside and demanded property from her," said John Cannon, a spokesman for the Houston Police Department.

When the man went to the garage to allegedly steal a parked Audi, Bun B retrieved a gun and came downstairs.

Bun B told police he went into the garage and when he saw the suspect in the driver side of his Audi turning in his direction, he started shooting. The suspect returned fire.

The suspect eventually fell out of the car after being struck in the exchange and fled the scene. He later showed up at a Houston hospital with a gunshot wound to the left shoulder.

Adams lauded Queenie Freeman, who was held at gunpoint, for convincing the intruder to take the key fob and head to the garage for the car, rather than go upstairs. The suspect sat in the car delayed, unable to find the push-button ignition.

"There was gunfight with Bun in the doorway to the garage. And (the suspect) sitting in Bun’s car, trying to start it. The guy just couldn’t figure it out," says Adams.

Bun B was not injured but Queenie Freeman is "still traumatized," says Adams. "But she would rather die than allow (the suspect) to get upstairs to her husband."

Police say Bun B saw the intruder without his mask and was able to identify him through photographs. Jackson will be charged with two counts of aggravated robbery and one count of burglary, both felonies.