Shinji Aoba was taken into police custody in hospital and was being treated there for burns.
The fire swept through Kyoto Animation (KyoAni) on Thursday, claiming at least 33 lives and injuring many in one of Japan’s worst mass killings in years.
People who witnessed Shinji Aoba’s arrest said they heard him complaining that the company had stolen his ideas.
Police said the attacker entered the building and splashed flammable liquid from a bucket before setting it alight, and shouted: “Die!”
In the wake of the attack, dozens of people gathered outside the premises of the studio, laying flowers and offering prayers. A crowdfunding campaign has so far raised more than $1.3m (£1.04m) to assist victims and their families.
KyoAni produces films and graphic novels and is well regarded by fans for the quality of its productions.
What do we know about the suspect?
Police detained Shinji Aoba on suspicion of setting fire to the building. Mr Aoba allegedly accused the animation studio of plagiarising his novel. He was taken to hospital for treatment and had not been formally interviewed about his motive.
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 had no idea if they were connected to the attack.
The fire broke out at the three-storey building at about 10:30 local time (01:35 GMT) on Thursday. Eyewitnesses described a loud explosion followed by the blaze, which people jumped out of windows to escape from.
“It was like I was looking at hell,” a local woman told Asahi Shimbun newspaper.
Around 70 people were in the building when the fire started, and some 36 people have reportedly been taken to hospital.
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.
Momoko Higuchi, a Tokyo-based architect, told Reuters that the blaze was probably made worse by the building’s three-storey spiral staircase, which would have “[acted] as a chimney.”
“Because the fire was with petrol, the effect was like a bomb,” Mr Higuchi added.
The fire was put out and police were searching the site for evidence. Knives were reportedly found at the scene.
Details of the victims were not immediately released but Kyoto police said 20 women and 12 men were among the dead. One person has not yet been identified. KyoAni is known for employing more women, particularly younger women, than is usual in the profession, industry lawyer Daisuke Okeda told the New York Times.
Men aged over 35 still dominate the animation industry, Mr Okeda said, but twice as many women in their 20s work as animators compared with their male counterparts.
In response to the incident, the studio has cancelled screenings for the trailer of its latest film, a spin-off of the popular swimming anime series Free. It has also delayed a collaboration with Keihan Main Line, a railway service between Kyoto and Osaka.
Another Japanese animation studio, David Production, postponed the broadcast of its latest episode of Fire Force. The animated series centres on a group of firefighters who have the ability to manipulate fire.
Who is Kyoto Animation?
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.
One of KyoAni’s series, Violet Evergarden, was picked up by Netflix for a global market. 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.