DINWIDDIE, Va. (AP) — A man mistook his best friend for an intruder outside his Virginia home and fatally shot him, authorities said.

Matthew Sharpf and his family were asleep in their home Tuesday night when Jonathan Hankins showed up unexpectedly, Sheriff’s Maj. William Knott told The Richmond Times-Dispatch.

Hankins “came banging around to the door and the side of the house,” Knott said. “I don’t know whether it was to shock him, or whether it was a joke or prank.”

Sharpf went to the door with a handgun and saw the silhouette of a person outside, Knott said. A shot fired through the front door struck and killed Hankins, he said.

“I don’t think he intended to shoot,” Knott said of Sharpf. “The gun discharged; it may have been an accident.”

Hankins, who apparently went to Sharpf’s house in Dinwiddie County for a visit, didn’t announce who he was while outside Sharpf’s home, Knott said. The men, both 37, had been best friends for years, Knott said.

Although the incident remains under investigation, Knott said there are no signs of a quarrel.

A member of Sharpf’s family called the sheriff’s office, and deputies found Hankins dead.

Sharpf was charged with voluntary manslaughter and released on an unsecured bond. He was arraigned Thursday and a preliminary hearing was set for July 26.