The detection and removal of bacteria, such as E. coli in aqueous environments by using safe and readily available means is of high importance. Here we report on the synthesis of nanodiamonds (ND) covalently modified with specific carbohydrates (glyco–ND) for the precipitation of type 1 fimbriated uropathogenic E. coli in solution by mechanically stable agglutination. The surface of the diamond nanoparticles was modified by using a Diels–Alder reaction followed by the covalent grafting of the respective glycosides. The resulting glyco–ND samples are fully dispersible in aqueous media and show a surface loading of typically 0.1 mmol g−1. To probe the adhesive properties of various ND samples we have developed a new sandwich assay employing layers of two bacterial strains in an array format. Agglutination experiments in solution were used to distinguish unspecific interactions of glyco–ND with bacteria from specific ones. Two types of precipitates in solution were observed and characterized in detail by light and electron microscopy. Only by specific interactions mechanically stable agglutinates were formed. Bacteria could be removed from water by filtration of these stable agglutinates through 10 μm pore-size filters and the ND conjugate could eventually be recovered by addition of the appropriate carbohydrate. The application of glycosylated ND allows versatile and facile detection of bacteria and their efficient removal by using an environmentally and biomedically benign material.