Click to email this to a friend (Opens in new window)

Click to share on Twitter (Opens in new window)

Click to share on Facebook (Opens in new window)

Houston rapper Bun B thwarted a gun-toting home intruder when he opened fire on the thug, shooting him after the crook forced his way inside and pulled a firearm on the recording artist’s wife Tuesday, according to reports.

The chaotic incident unfolded when Bun B’s wife, Queenie Freeman, heard the doorbell ring at the couple’s home on Knight Road in Houston at 5 p.m.

Freeman, who believed it was a delivery from Amazon, opened the door and masked 20-year-old suspect DeMonte Jackson pushed his way inside, the Houston Chronicle reported, citing police.

The intruder held Freeman at gunpoint, demanding they go upstairs.

Freeman knew her rapper husband was upstairs, so she instead offered her car keys and other possessions to the burglar.

“She was afraid he was there to cause harm to her husband,” Bun B’s attorney, Charles Adams, told the Chronicle.

That’s when Bun B, whose real name is Bernard Freeman, heard the commotion and quickly jumped into gear, running downstairs.

The rapper fired his handgun at Jackson while he was sitting in the couple’s car in the attached garage, prompting the crook to fire his handgun back at Bun B, police said.

Jackson, who suffered a gunshot wound to the shoulder, then ran off, but Bun B chased him down and forced him to take his mask off, the news outlet reported, citing cops.

The suspect eventually wound up at Pearland Medical Center and the rapper later fingered him in a photo array, authorities said.

Police charged Jackson with two counts of aggravated robbery with a deadly weapon and one count of burglary with intent to commit a felony.

He was booked at the Harris County Jail in lieu of $120,000 bond.

The terrifying incident is a “story of mutual courage” for both Bun B and his wife, Adams told the Houston Chronicle.

“It didn’t sink in until I left the home that they both could have been easily killed,” said Adams, adding that the suspect “happened to break into the wrong home.”

The attorney noted that he does not believe it was a targeted attack on the rapper.

Bun B is best known as a member of the hip hop duo UGK, which released the album “Ridin’ Dirty” in 1996.