A forensic psychiatrist is a medical doctor who specializes in the diagnosis and treatment of mental disorders in relation to the law, particularly in cases involving criminal behavior or the assessment of a defendant's mental state at the time of a crime.