Updated

President Ma Ying-jeou ordered Taiwan's police ministry to investigate what led a university student to stab four people to death on a crowded subway train in an attack that stunned this low-crime island.

The violence Wednesday at the start of rush hour in Taipei, a city of some 6 million people, was the first knife attack in the capital subway system's 18-year history. Another 21 people were injured before the attacker was captured.

"I feel extremely shocked and hurt by this grave event," Ma said on his Facebook page. He said he told the Cabinet to "order the National Police Agency to do all it can to check into the situation behind this case."

The suspect, a central Taiwan university student named Cheng Chieh, had said in an Internet commentary that he "wanted to do something big this year."

Students may be increasingly prone to violence because of pressures facing graduates, said Steve Chen, director of the Conflict Study and Research Center at Chang Jung Christian University in Taiwan.

They complain of a tough market for private sector or government jobs and, for men, little interest in compulsory military service, Chen said.

"They feel there's no hope," he said.

Passengers rushed out of the attacker's train car when it arrived at the Jiangzicui station on the metro's main east-west line, shouting for people on the platform to flee, according to news reports. Photos showed a train car floor and the station platform next to it splattered with blood.

Police arrived within minutes and took the suspect into custody.

Taipei's metro system raised security from Wednesday afternoon as trains resumed service just after 5 p.m. and into Thursday. About 1.78 million people ride the metro daily.

"I thought the metro system was OK today, although some people on the train were discussing the incident," said commuter Alice Chen, an accountant in her 40s. "They said it was terrifying. It's terrifying but I think it's a one-off incident."