The suspect was injured and was being treated in hospital, so police could not immediately question him, NHK said.

Japanese media reports said a man in his 40s had earlier bought 40 litres (nine gallons) of petrol at a nearby petrol station. Two containers used for the fuel were later found at the scene of the fire, Asahi Shimbun newspaper reported.

Meanwhile Kyoto Animation Director Hideaki Hatta told the broadcaster that the company had recently received threatening emails.

"They were addressed to our office and sales department and told us to die," he said.

Mr Hatta told reporters that he was "heartbroken" at the attack.

"It is unbearable that the people who helped carry Japan's animation industry were hurt and lost their lives in this way," he said.

What do we know about the studio?

Kyoto Animation, known as KyoAni, was founded in 1981 and has produced popular animation shows including K-On and The Melancholy of Haruhi Suzumiya.

The studio also released a standalone feature anime A Silent Voice in 2016.

One of KyoAni's series, Violet Evergarden, was picked up by Netflix for a global market.

Image copyrightReutersImage caption
Floral tributes have been left outside the building as people pay their respects to the victims

It also publishes many popular graphic novels, mainly about teenage school life.

The studio is known for paying its animators a regular salary, breaking with the industry's standard of paying per frame - which is seen as putting extreme pressure on staff.

It is also the first successful studio outside Tokyo, Prof Ryusuke Hikawa from Meiji University told NHK.

How have fans reacted?

Japanese anime has a huge following not just in Japan but around the world.

On social media, many fans have been expressing their shock and posting pictures of their favourite KyoAni shows.

A GoFundMe campaign titled "Help KyoAni Heal" has also been started, with more than $300,000 (£240,000) raised in six hours.

Voiceover artist SungWon Cho - who works on anime films - was among those to react.