Mr Aoba, 41, who suffered severe burns, is in police custody and has been transferred to a hospital in Osaka.

On Saturday, a man died in hospital from his injuries, bringing the death toll from the attack to 34.

The fire swept through the studio’s offices on Thursday morning, injuring many others in what was one of Japan’s worst mass killings in recent years.

One woman told Kyodo news agency that she spotted a man resembling Mr Aoba close to the KyoAni building on Monday. She said the man was carrying two boxes that appeared to contain petrol cans.

Two students also reported seeing a man on Wednesday evening dressed similarly to the suspect. One of the students said the man resembled Mr Aoba and was lying on a bench approximately 500m (1640ft) away from the office.

What do we know about the suspect?

Police detained Mr Aoba on suspicion of setting fire to the building. Mr Aoba had allegedly accused the animation studio of plagiarising his novel.

People who witnessed Shinji Aoba’s arrest said they heard him complaining that the company had stolen his ideas.

He was taken to hospital in Kyoto and, on Saturday, transferred to a hospital in Osaka. He has not yet been formally interviewed about his motive as police are waiting for him to recover from his injuries.

Public broadcaster NHK reported that he had a criminal record and was previously jailed for stealing money from a convenience store. Kyoto Animation’s president said he had recently received threatening letters but did not know if they were connected to the attack.

What happened on Thursday?

The fire broke out at the three-storey building at about 10:30 local time (01:35 GMT). Eyewitnesses described a loud explosion followed by a blaze, causing people to jumped out of windows to escape.

Police said the attacker entered the building and splashed flammable liquid from a bucket before setting it alight, and shouting: “Die!”

Authorities said most of the victims were found piled up on a stairway leading from the building’s third floor up to the roof, where they collapsed trying to escape.

Kyodo news agency said firefighters had found the door to the roof was shut, leaving people trapped inside. A Kyoto fire official also told Reuters news agency that the building did not have any sprinklers or indoor fire hydrants – but did not need them to comply with Japan’s fire code.

The fire was put out and police investigators searched the site for evidence.

Kyoto Animation was founded in 1981 and has produced popular animation shows including K-On and The Melancholy of Haruhi Suzumiya. The studio also creates film versions of some of its popular franchises, and released the standalone feature A Silent Voice in 2016 to critical acclaim.