Restoration of the 17th century Himeji Castle wrapped up Thursday after 5½ years of work.

The government marked the event with a ceremony, a day before the UNESCO World Heritage site was due to open to the public.

Roof tiles were replaced and the outer walls were repainted to restore the castle's elegant appearance.

With its white plastered earthen walls and six-story donjon, or central tower, the castle dates from 1609 and is a national treasure. It is also known as Shirasagi-jo (Egret Castle).

In 1993 it became the nation's first World Cultural Heritage site. The renovations, which began in October 2009, were the first since 1964.

"Himeji Castle stands today thanks to the passion of people living nearby," Masanori Aoyagi, head of the Cultural Affairs Agency, said at the ceremony. "The story of the major renovation work this time will be passed down to the next generation."

The Blue Impulse, the Air Self-Defense Force's aerobatic and precision flying team, flew over the castle in celebration of the work's completion.

The Himeji city office expects 1.8 million people to visit the castle in fiscal 2015, which begins April 1. The city also signed a pact with the operator of Germany's Neuschwanstein Castle on Thursday to boost cooperation in promoting tourism between the two popular castles.