A generator caught fire around 10 a.m. Tuesday on the roof of the RJT Edifice in Road Town, prompting the evacuation of the entire building. The edifice houses the Immigration Department and other government offices.

Jamie Gladman was in the immigration queue on the first floor at the time he was told to evacuate.

“We heard a massive vibration, and a technician came in a few minutes later telling us, ‘Evacuate, evacuate,’” said Mr. Gladman, general manager of Soggy Dollar on Jost Van Dyke, who stood with a crowd of other evacuees watching smoke pouring out of the roof.

Hewick Ambris was working on the fourth floor of the five-storey building and also reported a huge vibration, as well as seeing and smelling smoke.

An employee of the Department of Information and Public Relations, who works in the building but declined to be identified, confirmed that the generator had been giving them problems for months.

“They were trying to repair it but got themselves in a situation,” the employee said. “Normally they can turn it off and on, but this time it didn’t turn off.”

According to bystanders, police and firefighters arrived on the scene within minutes to extinguish the blaze, and employees were given the all clear to return to work by 11 a.m., though there was still a queue outside Immigration, waiting for doors to open.

There were no injuries, according to Brian Graziola, the technician from ATEC who was repairing the generator at the time.

Fire and Rescue Service Station Officer Tyrone Caddle confirmed around 11 a.m. that the fire had been extinguished and the all clear had been given, and employees began filing back into the building.

Mr. Caddle said there was damage to the generator and the wiring in the building, but he did not yet know the extent of the damage. Firefighters also could not yet state the precise cause of the fire. According to building officials, the generator dated back to 2005.

Despite the widespread use of generators after Hurricane Irma, Mr. Caddle said that this was the first major incident he had seen related to generator use.