The blaze was reported at about 4:30 p.m. on the 12th floor of the building located on City Center Drive, Hayward fire Capt. Thor Poulsen said. The fire was controlled at 5:06 p.m., Poulsen said.
The building has been vacant for a number of years after formerly serving as the home of City Hall and other businesses, he said.
A natural gas leak was also reported at the building after the fire, but Poulsen said the leak was in another part of the building and did not cause the fire. PG&E crews were at the scene as of 6 p.m. to fix the leak, he said.
No injuries were reported due to the fire.
Investigators were at the building this evening to look into the cause of the blaze.
In the past there have been many attempts by transients to enter the building, according to Poulsen.
He said authorities were treating the building like a crime scene while they investigate the cause of the fire.
"There are a couple things that have raised some eyebrows," he said.