The young man who confronted 76-year-old Charles Petit outside his Lincolnville home Sunday had parked his car a quarter-mile away.

He used a stun gun disguised as a cellphone to shock Petit.

He wore two sets of clothes: camouflage pants over blue jeans and a hooded sweatshirt over a sweater.

He knew Petit from the flea market where his mother worked. Petit sold jewelry there.

Those factors led investigators to think that 25-year-old Robert Deziel of Summerville meant to rob Petit, then shed a layer of clothing as he ran away.

That's why authorities ruled Thursday that Petit was justified when he pulled out a .38-caliber handgun and fatally shot Deziel.

Ninth Circuit Solicitor Scarlett Wilson said Petit's actions made up a classic case of self-defense based on legal doctrines that "go back eons."

He didn't need extra legal protections under the S.C. Protection of Persons and Property Act, a 2006 law that contains the state's "stand-your-ground" provisions. The statute can give immunity from criminal prosecution and civil liability to people who act in self-defense.

"Even if he had a duty to retreat, he could not do so safely because he was being attacked by a younger person," Wilson said. "This is a very clean, clear case of self-defense."

Wilson and Charleston County Sheriff Al Cannon announced the finding during a news conference Thursday afternoon.

Shortly after Petit called 911 to report the shooting about 6 a.m. Sunday, deputies started gathering evidence indicating that he had acted lawfully. But Cannon and Wilson said it was investigators' duty to further corroborate his story.

Deziel did not have a criminal history.

Petit told them that he ventured outside his house on Dunmeyer Hill Road to warm up his car, Cannon said. He planned to man his jewelry booth that day at the Coastal Carolina Flea Market in Ladson.

Outside his car, Petit was attacked. Deputies later found defensive wounds on his hands and an injury on his face.

Petit managed to reach his revolver. He was not required to have a permit to carry the gun because he was on his own property.

He squeezed the trigger five times. One of the rounds didn't go off. Of the four bullets that did fire, one hit Deziel in the chest.

Petit hurried inside and called for help. His wife also was at the home.

He told deputies that he didn't know the man who tried to rob him. The attacker had a hood pulled over his head.

But later, when he saw a photo lineup, Petit recognized Deziel from the flea market. Deziel's mother ran a booth there, and most of the merchants knew Petit, the sheriff said.

In Petit's front yard, deputies also found what at first appeared to be a cellphone. It had a screen featuring a photo of a mountainside lake, a button to access the phone's contacts and an icon for Facebook.

But users can't place calls on the Streetwise Immobilizer. It was designed to deliver a jolt of electricity.

"All of that pointed to him robbing (Petit)," Cannon said. "Petit was protecting himself."

Reach Andrew Knapp at 937-5414 or twitter.com/offlede.