A customer at a Washington state 7-Eleven shot and killed a masked man who charged into the convenience store swinging a hatchet on Sunday morning, according to authorities.

The 60-year-old customer was drinking a coffee around 5:30 a.m. (8:30 a.m. ET) when the hatchet-wielding man came into the store in Burien, about 10 miles south of Seattle, according to the King County Sheriff's office.

A hatchet wielding man was shot inside this 7-11 by a customer who had a gun. They protected clerk and themself pic.twitter.com/nOkeBTKi7b

The suspect first tried to attack the customer and then went after a clerk behind the counter, wounding him in the stomach, the sheriff's office said.

The quick-thinking customer drew a concealed pistol and shot the attacker before calling the police, the sheriff's office said in a statement. Medics attempted to resuscitate the suspect, but he was pronounced dead at the scene. The suspect has not been identified, but he is believed to be in his 40s.

The shooting will be investigated, and the case will be sent to a prosecutor to determine if charges should be filed against the shooter. King County Sheriff Sgt. Cindi West told NBC News that "during the initial investigation we did not see any wrongdoing on the part of the citizen who shot."

"In fact, he may have prevented the clerk from being killed or seriously injured," she said.

The King County Sheriff's Office said the customer has a valid concealed pistol license.