A state appellate court threw out the conviction of a Davie man because a judge refused to hold a pretrial competency hearing after learning the defendant had a history of mental illness.

“A bedrock principle of due process is that it is constitutionally impermissible to hold criminal proceedings against a mentally incompetent defendant,” Fourth District Court of Appeal Judge Martha Warner wrote in an opinion issued Wednesday.