Objectives Insomnia is one of the common disorders whose relationship with depression and anxiety is widely discussed. The current study aimed at investigating the epidemiology of insomnia and its relationship with depression and anxiety among male prisoners. Methods In the current study, 110 male prisoners were selected through the convenient sampling method. To collect data, Pittsburgh sleep quality index, Beck depression inventory, and Beck anxiety inventory were used. Data were analyzed using multiple regression analysis and Pearson correlation coefficient.Results Depression and anxiety had a significant relationship with insomnia (P<0.0001). The results of multiple regression analysis showed that depression and anxiety could predict the insomnia with 0.29 variance.Conclusion Given the high prevalence of insomnia among prisoners and its relationship with depression and anxiety, it seems necessary to provide psychological services to decrease insomnia and its underlying factors.