Police identified a 33-year-old unemployed man as the suspect in the case, AFP reported. Video footage shows crowds beating the man as he was being taken to a prosecutor's office for questioning on Monday, according to the wire service.
Authorities haven't released a motive in the attack. Police said the suspect has been previously treated at a psychiatric hospital, but doesn't have a government-issued disability card, according to the Taiwanese Central News Agency.
The broad-daylight attack has heightened fears in the Taiwanese capital. Another seemingly random knife attack took place on Tuesday when a transit police officer was stabbed in the head, the Associated Press reported. The officer's injuries were described as not life-threatening.
Crowds gathered at the site of the killing to leave flowers and toys in honor of the girl, nicknamed "Little Lightbulb." Her family called her that because she was cheery and outgoing, according to BBC.
"This incident deals a big blow to Taiwan's society. Many Taiwanese people are saddened and feel insecure," said President-elect Tsai Ing-wen, who laid flowers at the scene, AFP reported. "We should work together so parents don't have to worry and children can grow up safely."
The attack has also renewed a debate about capital punishment. Taiwan has faced international criticism for its use of the death penalty, including by the European Union. A moratorium on the death penalty that began in 2006 ended in 2010. Human rights groups have campaigned to abolish the practice since.
In 2015, Taiwan executed six men convicted of murder after the brutal killing of an 8-year-old girl. Amnesty International said at the time the series of executions “reeks of political calculations by a government attempting to gain points by quelling public anger.”
Wang Yu-min, a legislator, has proposed a bill that would require a death penalty sentence for anyone convicted of killing children under 12, except in cases of severe mental illness. Parliament will review the proposal this week, according to AFP.
“Who is to return the right and justice to Little Lightbulb after she died in such a horrible way,” said Wang. “We call on all of you to support my proposal that those who murder children under the age of 12 be automatically sentenced to death, or under specific circumstances, jailed for life.”
But the girl's mother, who spoke to reporters after the killing, urged the public not to turn her daughter's death into a debate about the death penalty.
"If you are concerned about us or have sympathy, please respect us," the mother said, AFP reported. "I don't wish to see such discussions at the time being."
The mother, who is not named by media reports, also detailed what happened on Monday. She and her 4-year-old were on their way to meet the girl's grandfather for lunch; the mother said her daughter was riding a strider bike when she had trouble getting it onto the sidewalk, according to CNA.
The girl was about a meter away, and the mother said she thought a stranger who approached was going to help the girl get it onto the sidewalk.
"I saw the suspect slashing my daughter with a cleaver," the mother said, according to CNA. "I immediately grabbed him, but I could not pull him away."
Police said seven bystanders, as well as the mother, unsuccessfully tried to pull the man away, AFP reported.
"I am very sad," the mother said, according to CNA. "I will never see her again.'