On Thursday night, Japanese Emperor Naruhito is to perform an ancient, highly secretive ritual, costing hundreds of millions of dollars in total, in which he feasts and spends the night with a mysterious “sun goddess”.

The once-in-a-reign event, known as the Daijosai, is apparently to give thanks for good harvests, pray for the peace and safety of the nation and play host to his family’s ancestral gods.

At least that’s what experts and officials say.

The private event, which costs a total of 2.8bn yen ($25m) and is taxpayer-funded, is said to be the most important succession ritual an emperor performs.

However, it has drawn criticism, not only because of the secrecy and the cost, but also because of the speculation the emperor uses a ceremonial bed, brought into the purpose-built complex, to have sex with the goddess.

Emperor Akihito abdicates: In pictures Show all 11 1 /11 Emperor Akihito abdicates: In pictures Emperor Akihito abdicates: In pictures Emperor Akihito in a private ritual as part of his abdication ceremony at the Imperial Palace in Tokyo Reuters Emperor Akihito abdicates: In pictures Emperor Akihito speaks during his abdication ceremony at the Imperial Palace in Tokyo AP Emperor Akihito abdicates: In pictures The Yomiuri Shimbun, a Japanese newspaper, splashes on the abdication of Emperor Akihito Getty Emperor Akihito abdicates: In pictures Emperor Akihito at three-months-old in 1934 AFP/Getty Emperor Akihito abdicates: In pictures Then Crown Prince Akihito on his wedding day at the Imperial Palace in Tokyo in 1959 AFP/Getty Emperor Akihito abdicates: In pictures Then Crown Prince Akihito plays tennis at the residence of then US Vice President George Bush Sr. in 1987 AFP/Getty Emperor Akihito abdicates: In pictures Emperor Akihito and then Chinese President Yang Shangkun outside the Great Hall of the People in Beijing in 1993 AFP/Getty Emperor Akihito abdicates: In pictures A young Emperor Akihito on horseback in the 1950s AFP/Getty Emperor Akihito abdicates: In pictures Then Crown Prince Akihito (centre) on a visit to France's Chateau de Versailles in 1953 AFP/Getty Emperor Akihito abdicates: In pictures Then Crown Prince Akihito and Crown Princess Michiko welcome visiting Prince Charles and Princess Diana to the Tōgū Palace in Tokyo in 1986 AFP/Getty Emperor Akihito abdicates: In pictures Then Crown Prince Akihito and Crown Princess Michiko with their child Naruhito, who is to become Japan's emperor, in 1960 AFP/Getty

It is not clear who the goddess is or how she is selected.

According to a report by AP, some experts believe the bed is used so the emperor can sleep with the sun goddess to gain divinity. Others say it’s for the goddess to rest and that it’s not even touched by the emperor.

Japanologist John Breen told CNN that in the 1920s, the belief accepted by the state was that the emperor engaged in sexual activity with the sun goddess.

He reportedly said the two main halls used in the ceremony are furnished with a bed covered with a silk sheet – and the theory was the emperor lay on the bed, covered himself with a sheet, and waited for the sun goddess to come down from heaven and enter his body.

However, in 1990 when former Emperor Akihito, the current emperor’s father, underwent the rite, the Imperial Household dismissed the theory, saying that the emperor doesn’t lie on either bed.

Instead, the beds were apparently there to “welcome the weary sun goddess who comes down from heaven.”

“The so-called bed, as we understand it, is a sacred seat for the imperial ancestor to rest,” then-Prime Minister Toshiki Kaifu said before the Daijosai in 1990.

Officials have denied that the emperor uses the bed to gain divinity.

Japanese television showed Naruhito, accompanied by assistants, walking slowly in a hallway and then disappearing behind white curtains at the entrance of the Yukiden.

He was expected to offer arcane prayers for peace and bountiful harvests in the direction of Japan‘s most sacred shrine at Ise, where the sun goddess is believed to be enshrined, then partake of the offerings in a symbolic communion. After a short break, he was to perform a similar ritual at another main hall.

The venue, called the Daijokyu, is a one-off shrine complex of about 30 structures in various sizes, including two main halls, all of which will be demolished afterwards.

The buildings alone costs about 2 billion yen ($18 million), and the whole ritual will total about 2.7 billion yen ($25 million).

It is all funded by the government. The ritual shrank when Japan was ruled by warlords and the monarchy had little money and power, and there was a 200-year hiatus before it was restored during the Tokugawa shogunate, which ruled from the 17th to the 19th century.

The current government’s funding of the religious rite remains contentious.

A group of more than 200 people filed a lawsuit against the government last year, saying the ritual violates the constitutional separation of state and religion. The wartime government turned Shinto into a fascist ideology to promote its colonial aggression.

Shinzo Abe’s government says even though the rite is too religious to be considered an official duty of the emperor, it is an “extremely important” succession ritual for the country’s hereditary monarchy written in the constitution and therefore it serves the public interest and deserves state funding. The cost is paid in the name of “palace expenses,” which ordinarily cover maintenance and ceremonial spending by the palace, following a precedent set by the government at the time of the earlier event.