TOKYO (AP) — A fire broke out early Thursday and spread quickly through historic Shuri Castle on Japan’s southern island of Okinawa, nearly destroying the UNESCO World Heritage site.

Firefighters battled the blaze for about 12 hours before bringing it under control in the afternoon.

The fire in Naha, the prefectural capital of Okinawa, started from the castle’s main structure and quickly jumped to other buildings. Three large halls and four other structures burned down, a fire official said.

No one was injured. The cause was not immediately known.

An annual weeklong castle festival that began Sunday was to run for a week but the remaining events were canceled.

Video on NHK public television showed parts of the castle engulfed in flames, then turning into a charred skeleton and collapsing to the ground. Many residents watched from a hillside road and quietly took photos to capture what was left of the castle before it was largely lost. Some people were crying.

“I feel as if we have lost our symbol,” said Naha Mayor Mikiko Shiroma, who led an emergency response team. “I’m shocked.”

Okinawa Gov. Denny Tamaki cut short a trip to South Korea to return to Naha. “My heart is broken,” he said. “But I also feel strongly that we must reconstruct Shuri Castle, a symbol of the Ryukyu Kingdom filled with our history and culture.”

The castle is a symbol of Okinawa’s cultural heritage from the time of the Ryukyu Kingdom that spanned 450 years from 1429 until 1879, when the island was annexed by Japan.

It is also a symbol of Okinawa’s efforts to recover from World War II. The castle burned down in 1945 during the Battle of Okinawa near the war’s end, in which about 200,000 lives were lost on the island, many of them civilians.

The castle was largely restored in 1992 as a national park and was designated a UNESCO World Heritage site in 2000 as part of a group of ancient ruins, castles and sacred sites that “provide mute testimony to the rare survival of an ancient form of religion into the modern age.”

Chief Cabinet Secretary Yoshihide Suga told reporters that the central government will do its utmost to reconstruct the castle.

The government dispatched officials from the Agency for Cultural Affairs and other government organizations to join efforts to investigate the cause of the fire and study ways to protect other historical sites from disasters, Suga said.

Kurayoshi Takara, a historian at the University of the Ryukyus who helped reconstruct Shuri Castle, said he was speechless when he saw the fire. He told NHK that the castle reconstruction was a symbolic event for Okinawans to restore their history and Ryukyu heritage lost during the war.

“I still can’t accept this as a reality,” Takara said. “It has taken more than 30 years and it was a monument to the wisdom and efforts of many people. Shuri Castle is not just about the buildings, but it reconstructed all the details, even including equipment inside.”

UNESCO Director General Audrey Azouley expressed her sympathy. “Deep emotion and sincere solidarity with the Japanese people as we see the tragic fire at the beautiful #shuricastle,” she wrote on her Twitter account. “This is a loss for all humanity.”

Okinawa was under U.S. occupation until 1972, two decades after the rest of Japan regained full independence.