He told police the plants were a "hobby" that he intended to use on his own, the paper reported.
Witnesses told the Times that, after the judge read the sentence out loud, Marhanka turned to the interpreter, who informed him of the sentence.
"Four years?" a shocked Marhanka was heard saying.
Witnesses told the paper that the interpreter explained to Marhanka that the sentence could be appealed, but Marhanka said he didn't want to do so.
"I don't want to live anymore," he yelled, before stabbing himself in the neck and severing at least one artery, witnesses said. He was taken to a hospital, but doctors were unable to revive him, according to Agence France-Presse.
"We deeply regret that Tyrel Martin Marhanka killed himself during the sentencing," the court said in a statement. "He was cooperative during the investigation and the trial. His attitude was mild and he did not show any signs that he would commit suicide."
Marhanka was married to a Taiwanese woman and had two children, and they were longtime residents of the island, AFP reported.
Court officials told the Times that they plan to improve security by installing an X-ray machine that will be used to scan people before they enter a building. The court's current facility, AFP reported, lacks adequate space for the equipment.