A nationwide study of Shiga toxin-producing Escherichia coli (STEC) was performed to determine the prevalence, characteristics and risk factors for fecal shedding of STEC among cattle in Japan. Information on rearing practices was also collected to identify risk factors for fecal shedding of STEC. STEC was isolated from 24·1% of samples (133/551) collected from 59·1% of farms (65/110). Bayesian clustering using the virulence marker profiles of the isolates subdivided the isolates into four genetically distinct groups, two of which corresponded to eae- or saa-positive STEC, which can cause severe disease in human. Both STEC groups exhibited characteristic phylogeny and virulence marker profiles. It is noteworthy that the tellurite resistance gene was not detected in all saa-positive STEC isolates, suggesting that the standard isolation method using tellurite might lead to an underestimation of the prevalence of saa-positive STEC. A multivariate logistic regression model using epidemiological information revealed a significantly (P < 0·01) high odds ratio on STEC fecal shedding in tie-stall housing and a low odds ratio in flat feed box and mechanical ventilation. Information on isolate characteristics of the two major pathotypes and risk factors in rearing practices will facilitate the development of preventative measures for STEC fecal shedding from cattle.