LUTZ — When a masked man walked into a convenience store Thursday morning and pointed a gun at the clerk and a customer, the customer shot the man in the leg, authorities said.

It wasn't until afterward that the customer learned the man he had shot was one of his former employees, according to the Pasco County Sheriff's Office.

"(He) feels bad he had to shoot somebody he knew," said sheriff's spokesman Kevin Doll.

Sheriff Chris Nocco said the customer did the right thing.

"If you're in a life-or-death situation," Nocco said, "you absolutely have your God-given right in Pasco County to defend yourselves."

The Sheriff's Office did not identify the customer or the clerk in this account of the incident:

It was 6:40 a.m. when Christopher Lilly, 30, walked into the 54 Food Mart convenience store at 26556 Wesley Chapel Blvd. wearing a black mask and holding a gun, deputies said. He demanded money and ordered the clerk and the customer into the walk-in cooler.

The customer was armed, deputies said, and handed his gun to the clerk, who exited the cooler and fired a warning shot. Lilly then dropped the gun and the clerk and customer tried to subdue him, Doll said.

During the wrestling match, Lilly tried to reach for his dropped gun. That's when the customer reclaimed his weapon and shot Lilly in the right thigh. The customer had a permit to carry a concealed weapon, deputies said.

A passer-by called 911, Doll said, and a deputy responded within two minutes. The deputy arrived as the wounded Lilly was trying to run from the store.

Once Lilly was in custody and his mask removed, the customer who shot him realized Lilly used to work for his landscaping company.

Lilly was flown to a nearby hospital for treatment of what deputies described as injuries that weren't life-threatening. Once released, he was booked into the Land O'Lakes Detention Center, where he is being held in lieu $55,000. He faces charges of armed robbery and aggravated assault with a deadly weapon, Doll said.

The sheriff said the customer said he wanted to wound Lilly, not to kill him.

"I just wanted to stop his actions," the customer told deputies, according to Nocco.

The investigation was ongoing Thursday, which is why the Sheriff's Office withheld the names of the customer and clerk. But, Doll said, it was unlikely that the customer will face any charges in the shooting.

"(The customer) definitely stopped the crime from being committed and may have saved someone's life," Doll said. "Preliminary information indicates he exercised his right with a concealed weapons permit — he was in accordance with the law in what happened."

Doll said Lilly had a domestic violence injunction filed against him, so he could not legally possess a gun. Lilly has been arrested 11 times in Florida, state records show, all in Pasco and Hillsborough counties. In 2012 records show he was found guilty of battery and spent two months in jail.

Times senior news researcher John Martin and staff writer Samantha Putterman contributed to this report. Contact Josh Solomon at (813) 909-4613 or jsolomon@tampabay.com. Follow @josh_solomon15.