Since the discovery of the trans-neptunian objects (TNOs) in 1992, nearly one thousand new members have been added to our Solar System, several of which are as big as--or even larger than--Pluto. The properties of the population of TNOs, such as the size distribution and the total number, are valuable information for understanding the formation of the Solar System, but direct observation is only possible for larger objects with diameters above several tens of kilometres. Smaller objects, which are expected to be more abundant, might be found when they occult background stars, but hitherto there have been no definite detections. Here we report the discovery of such occultation events at millisecond timescales in the X-ray light curve of Scorpius X-1. The estimated sizes of these occulting TNOs are < or =100 m. Their abundance is in line with an extrapolation of the distribution of sizes of larger TNOs.