The toll continued to climb, with fire department saying bodies are being discovered as they search.

A motive for the apparent attack remained unclear hours after the blaze. If arson is confirmed, the attack will be among the deadliest criminal acts in decades in Japan, where violent crime is extremely rare.

The fire gutted the three-storey building in the city of Kyoto that housed Kyoto Animation, behind famous anime television productions. The incident sparked an outpouring of support from the industry and fans worldwide, including a viral fundraising campaign.

Late Thursday evening, a local fire department official said the toll stood at 33 dead.

"Of the 33, two were found on the ground floor, 11 on the second and 20 on the third and also on the staircases that lead to the rooftop," the official told AFP.

Another 36 people were injured, including 10 in serious condition, he said, adding that all those inside the building during the blaze were now accounted for.

The horrific fire appeared to have been set in the middle of Thursday morning, with the fire department saying they began receiving emergency calls around 10:30am.

The blaze left people with serious wounds, eyewitnesses said.

"I saw people who were totally black or covered in blood, or who had suffered burns all over their body," a 53-year-old woman told the Kyodo news agency.

As the fire gutted the building, it sent thick white smoke out through the windows, and the flames charred the facade black before firefighters were eventually able to tame it hours after it began.

'Lost for words'

Japan's Prime Minister Shinzo Abe took to Twitter to express his horror. "It's so dreadful that I'm lost for words," he wrote.

"I pray for those who passed away."

Police said they were still investigating the cause of the fire but that it was a suspected arson attack.

"A man threw a liquid and set fire to it," a Kyoto prefectural police spokesman told AFP.

Public broadcaster NHK reported that a man had been detained in connection with the blaze and was later taken to hospital for treatment. He reportedly suffered serious injuries in the fire.

NHK said the suspect had poured a gasoline-like substance around the building and said "drop dead" as he set fire to it.

The eyewitness who spoke to Kyodo said one of the injured "claimed to have been splashed with kerosene or something like it".

Local media reported that the suspected attacker appeared to also have been armed with knives.

'Why, why, why?'

Kyoto Animation's president Hideaki Hatta told reporters "there have been emails with death threats", without giving further details.

He said the building gutted by the blaze was "the core of the company", which has produced several well-known television anime series including "The Melancholy of Haruhi Suzumiya" and "K-ON!"

"It's unbearable that those who have led Japan's animation industry were hurt and lost their lives."

The blaze prompted an outpouring of support from those in Japan's anime industry, one of the country's best known cultural exports, and fans around the world.

"No, I don't know what I should be thinking now," tweeted Yutaka Yamamoto, an animation director who once worked at Kyoto Animation.

An online fundraiser organised by an American anime licensing firm had raised more than $420,000 by late Thursday night, and anime fans around the world were tweeting their support with the hashtag #KyoAniStrong and #PrayForKyoAni.

Japan has a famously low crime rate. Arson is considered a serious crime and people convicted of deliberately setting fires in a country where many people still live in wooden houses can face the death penalty.

A man convicted of setting a fire that killed 16 people in Osaka in 2008 is currently on death row.

In 2016, a knife-wielding man went on the rampage at a care home for the mentally disabled, killing 19 in the country's worst mass killing in decades.