A gun scare ended peacefully Thursday night in Clarence after a 4½-hour standoff, and the Erie County Sheriff’s Office says it was simply a case of deputies concerned for the armed man’s well-being.

Once the situation was resolved, the man was taken to Erie County Medical Center for a mental health evaluation.

Police received a call at about 3:30 p.m. that a 26-year-old man on Heise Road was distraught and had a long gun. When sheriff’s deputies arrived, the man had gone to a large property, more than 100 acres, that his family owns. He was not detained until 8:07 p.m.

At that point, the Sheriff’s Office would not say if he was “in custody,” because it was not clear whether he had broken any laws, but rather that he was being questioned.

“There was never any threat to either law enforcement, the community,” said Scott M. Joslyn, chief of police services for the Sheriff’s Office.

The man is believed to have called his parents at about 4:30 p.m. and said, “Listen to this.” Then a gunshot sounded, officials said. About 45 minutes later, another gunshot was heard in the woods, authorities said.

The man fired “at least one shot,” Joslyn said, and “the intended target, we don’t know.” But he emphasized that the man was within his rights, if he abided by the law, to discharge a firearm in that area.

Joslyn said it was too early to comment on whether any charges would be filed.

He said the man did not make any threats or exhibit threatening behavior. Joslyn said during the standoff that there was “an open line of communication” with the man.

Joslyn said the man was “communicating nicely” with officers, expressing that he wanted to be left alone and was within his rights.

The Sheriff’s Office, the State Police and the FBI had negotiators on scene who were able to convince the man they were merely concerned for his safety and well-being. He then walked out to the officers peacefully.

“I think that you prepare for the worst and hope for the best, and that’s what we did here tonight,” Joslyn said.

Joslyn said that 15 to 18 residences on the east and west sides of Heise and north side of County Road were evacuated.

Eastern Hills Mall, about 6 miles from the search area, was briefly put on lockdown as a precaution.

Mall officials said they lifted the lockdown after being told by sheriff’s officials that the suspected gunman had been “pinned to one area.”

Deputies set up a perimeter around Heise, County, Lapp and Green Acres roads.

Joslyn said the man did not have a criminal record and was a registered gun owner.

He added that the man’s mother was “very grateful” that the situation ended as it did.

“The family is elated that it came to a quick resolution,” Joslyn said.