A teen was facing charges for a would-be armed home invasion robbery in Florida in which his two accomplices were shot and killed and he was wounded, authorities said.

The person who shot them was the homeowner victim who had a gun and used it to defend himself when he encountered the intruders in his home in Wesley Chapel shortly before 1 a.m. Friday, Pasco County Sheriff Chris Nocco said.

“The victim in this case was exercising his Second Amendment right to protect himself in his home,” Nocco said.

 POLICE ARREST 5 PEOPLE IN CONNECTION WITH RAPPER POP SMOKE'S MURDER

Luis Casado, 21, and Khyle Durham, 21, were shot as they walked down a narrow hallway toward the homeowner, the sheriff said. They had guns and covered their faces with black masks.

Jeremiah Trammel, 19, was shot after Casado and Durham went down, Nocco said. He said he ran out of the house as the homeowner went to get another gun to replace the one he had because it jammed.

Nocco said Trammel didn't get far. A neighbor with a gun caught him and then held him until deputies arrived.

Trammel was admitted to a hospital for treatment of the gunshot wound.

DOORBELL VIDEO CAPTURES VIOLENT ILLINOIS HOME INVASION WHICH LEFT CORONAVIRUS MASK-WEARING SUSPECT DEAD

Nocco said Casado and Durham were “extremely violent” criminals. He said Trammel had a previous arrest for battery and other charges.

He said the shooting happened after the homeowner heard glass shatter and grabbed a gun. He was home alone playing video games.

The sheriff said the homeowner believes he may have been targeted because of his gun collection, which he has displayed on social media.

The investigation also revealed that the homeowner had some sort of relationship with Trammel, Casado and Durham that involved “some type of known entity,” Nocco said.

CLICK HERE TO GET THE FOX NEWS APP

Trammel was charged with home invasion robbery, Fox 35 Orlando reported. He was also charged with murder for the deaths of Casado and Durham during the commission of another crime.