He cried in court after being told he would have to "live with the shame for the rest of his life".