Sunspot umbrae-the dark central regions of the spots-are surrounded by brighter filamentary penumbrae, the existence of which remains largely inexplicable. The penumbral filaments contain magnetic fields with varying inclinations and are associated with flowing gas, but discriminating between theoretical models has been difficult because the structure of the filaments has not hitherto been resolved. Here we report observations of penumbral filaments that reveal dark cores inside them. We cannot determine the nature of these dark cores, but their very existence provides a crucial test for any model of penumbrae. Our images also reveal other very small structures, in line with the view that many of the fundamental physical processes in the solar photosphere occur on scales smaller than 100km.