We investigated faecal samples collected from the rectum of 518 cattle on 371 randomly selected smallholdings in Bangladesh for the presence of sorbitol non-fermenting (SN-F) shiga toxin-producing Escherichia coli (STEC). The SN-F isolates were tested for the presence of rfb O157, stx1, stx2, eae and hlyA genes by polymerase chain reaction (PCR). Seven SN-F isolates lacking these genes were profiled by pulsed-field gel electrophoresis (PFGE) to verify their clonality. SN-F E. coli was identified in 44 [8·5%, 95% confidence interval (CI) 6·4–11·2] samples; of these, 28 (5·4%, 95% CI 3·8–7·7) had shiga toxin-producing strains, although only two carried the rfb O157 gene. Thirteen isolates carried the hlyA gene while 18 harboured the eae gene. Based on PFGE, six pulsotypes were observed among the seven isolates that had no virulence genes. To the best of our knowledge this is the first report on shiga toxin-producing E. coli from direct rectal faecal samples of cattle on smallholdings.