A power station generator exploded because of mechanical problems, said police and government officials on the Rock, a tiny British-held peninsula on the southern tip of Spain.
As thick smoke billowed over the territory, police told nearby residents to keep their windows closed to avoid breathing problems.
No one was harmed, police and a spokesman for the Gibraltar government said.
But the blaze interrupted Gibtelecom services, bringing down worldwide betting services such as Ladbrokes, William Hill and Betfred.
More From This Section
William Hill said the blaze forced its services offline for about two and a half hours.
Some 50 staff at the William Hill offices adjacent to the fire were evacuated by police and firefighters, said spokesman Graham Sharpe.
"It is just one of those freak events nobody could have predicted," Sharpe told AFP, offering apologies to any affected customers.
"There will be those who will claim they would have backed a winner but there will be others who have been saved from backing a loser," the spokesman said.
Ladbrokes said it, too, was hit as the fire interrupted Gibtelecom's communications network linking the territory with the rest of the world.
"We apologise to the customers who were affected by the loss of some of those services yesterday afternoon and have been working hard and successfully to restore these," Ladbrokes said in a statement.
"None of our staff were affected by the incident, and no customer data was compromised during that period," it said.
Betfred's Internet site was still down in the evening, some six hours after it alerted customers to the problem via Twitter.
Gibraltar police said investigators had ruled out foul play.