A man on the roof of a commercial building around William Street and Transit Road jumped off the structure, ending a standoff that began at around 9:20 p.m. Wednesday, Lancaster police said.

Thomas Bailey, 37, of Lancaster, was given first aid and transported by ambulance to ECMC with internal injuries, police added. He will be held for a mental evaluation.

The incident began when police received reports of a male, claiming to have a gun and threatening to shoot people, on the roof of a building under construction around William Street and Transit Road.

Traffic around that area was cordoned off, and a police SWAT team and the Erie County Sheriff’s Air One helicopter were called to the scene, according to Lancaster police.

Nearby restaurants and a movie theater in the busy commercial area were locked down as a precaution.

According to Lancaster police, a negotiator was on the scene to speak with Bailey, but initial attempts to contact him were unsuccessful. Police later were able to speak with him by cellphone for several hours. But at around 12:50 this morning, he suddenly jumped off the roof.

There were no confrontations and no shots were fired. Lancaster police would not confirm whether Bailey had a gun.

Cheektowaga, Depew, West Seneca and State police assisted Lancaster police, who are continuing their investigation.