Tuberculosis is a chronic, debilitating and highly contagious zoonotic disease threatening animals and public health. This study was designed to investigate the occurrence of Mycobacterium tuberculosis and Mycobacterium bovis and to identify the risk factors associated with the disease in milk samples of dairy animals. A total of 200 milk samples were collected from lactating animals and milk shops of five randomly selected union councils of district Kohat, Pakistan. The epidemiological and herd management data was collected on a pre-designed questionnaire. All milk samples were first screened by direct microscopy, followed by molecular detection of M. tuberculosis and M. bovis using PCR assay. Overall, PCR based prevalence of tuberculosis causing bacteria was 7.5%. The high prevalence rate of M. bovis was found in cattle (6.4%), followed by buffaloes (6.2%), while the prevalence of M. tuberculosis was higher in goats (6.3%). A higher prevalence of M. bovis (15%) was found in the Khushal Ghar area. Moreover, the prevalence was also high in milk samples collected from milk shops (7.4%). Additionally, animal herd size and hygienic measures significantly (P<0.05) contributed to the prevalence rate. The prevalence rate in the age group of >8 years was found higher compared to other age groups. Furthermore, the high prevalence rate was found in animals having close contact with other animals in communal grazing and watering. This study concluded that some factors influence significantly in the prevalence of tuberculosis. Thus, actual managemental practices might be helpful in control and prevention of these pathogenic bacteria.