Japan's Emperor Naruhito wore white clothes and went to a dark wooden hall on Thursday evening to begin his last ritual after he became emperor last spring, spending the night with the "goddess of the sun."

The ritual of Daigusai is centered on the sun goddess Amaterasu Omikami, whose ancient legend says the emperor descended from her descendants. Naruhito has to perform several rituals to succeed his father, Akihito, who has abdicated the throne.

The weather, which lasts until Friday morning, has triggered lawsuits from critics of communists and Christians who say it violates a constitutional provision calling for the separation of religion from the state, with the government costing 2.7 billion yen ($ 25 million) to implement.

Legend has it that the emperor has a marriage relationship with the goddess, a belief that dates back to an era when the emperor was considered a goddess and ended after World War II when Naruhito's grandfather Hirohito was de-sacred.

"The ritual is a feast that the emperor takes with the goddess," said John Breen, a professor at the International Research Center for Japanese Studies in Kyoto.

On an unusually warm night at a time in Tokyo, attendees gathered in an open courtyard, including Prime Minister Shinzo Abe.

Later, the emperor appeared in live television footage, leading the torchbearers into dark wooden corridors, followed by Empress Masako, wearing a traditional white 12-layer garment.

After the emperor disappears behind the white curtains in the dimly lit hall, he kneels beside straw cushions wrapped in white cloth and is accompanied by only two temple girls to prepare 32 according to the sun goddess of oak leaves before praying for peace in Japan.