Taiwan has executed a man who was convicted of killing four people in a subway stabbing spree two years ago.

The Ministry of Justice says Cheng Chieh was executed Tuesday night. It did not say what method was used, but prisoners in Taiwan are usually sedated and then shot.

Cheng's two-minute attack on a subway train during rush hour in Taipei on May 21, 2014, left four people dead and 22 injured.

Cheng, who was a university student at the time, gave no explanation for the stabbing spree, other than a Facebook posting in which he said he "wanted to do something big."

The ministry says the death sentence was necessary because of the severity of the crime and public demands to uphold social justice.