Background and Aim: Onychomycosis is the fungal infection of nails. Patient’s immune system has an important role in initiation of onychomycosis. One of the causes of the increased prevalence of onychomycosis is the increasing number of patients with local or general immune system disorders. In hormonal disorders such as diabetes mellitus, Cushing's syndrome and hypothyroidism; superficial vascular disorders and individuals with immune deficiency, onychomycosis prevalent. The aim of this study was to investigate onychomycosis in individuals with underlying diseases who referred to Razi hospital in Tehran.Methods: In this cross-sectional study, nail specimens of 250 patients who have nail dystrophy with an underlying disease whom were referred to mycological laboratory of Razi hospital in 2010-11 were evaluated with direct microscopy and culture on Sabouraud dextrose agar and Sabouraud dextrose agar containing chloramphenicol and cyclohexamide. For differential diagnosis of fungi, complementary tests were used.Results: Eighty-nine (35.6%) of 250 individuals with underlying diseases and nail dystrophy, were affected with onychomycosis. Among these pateints, 52 (58.4%) cases had yeast infection, 19 (21.3%) had dermatophyte infection, and 18 (20.2%) had saprophyte infection. Diabetes mellitus (37.1%), cardiovascular diseases (14.7%), pemphigus (9%), psoriasis (7.9%), hypothyroidism (6.7%) and chronic eczema (5.6%) were the most common underlying diseases observed in patients with onychomycosis.Conclusion: Onychomycosis is common in hormonal disorders like diabetes mellitus and hypo-thyroidism; superficial vascular disorders and individual who suffer immunodeficiency.