Members of the public laid out flowers and cards to pay tribute to those who died in the attack at Jiangzicui subway station.
Three people -- a 28-year-old man, 26-year-old man and 47-year-old woman -- died at the site, from stab wounds to the neck and chest, while a fourth victim, a 62-year-old woman, died later in hospital, police said.
The lone attacker, Cheng Chieh, a 21-year-old college student, is in custody undergoing further questioning.
Twenty-four people were wounded, around half of them seriously, the New Taipei City government said.
During the regular cabinet meeting, Premier Jiang Yi-huah conveyed his condolences to the family of the victims and ordered the police authorities to launch an in-depth investigation.
The Taipei subway system became operational in 1996, and this was the first attack of this kind on it.
The spokesman for the Panchiao district court said the suspect had admitted he was guilty, but declined to reveal further details.
When the train pulled into the next station, Cheng fled and was chased by police before being kicked to the ground by a passenger and overwhelmed by a group of security officials and subway riders.
Chen Kuo-en, chief of the New Taipei City police bureau, told reporters hours after the event: "He told the police that he had wanted to do a 'big thing' such as this since his childhood.
