Complex animals first evolved during the Ediacaran period, between 635 and 542 million years ago, when the oceans were just becoming fully oxygenated. In situ fossils of the mobile forms of these animals are associated with microbial sedimentary structures, and the animal's trace fossils generally were formed parallel to the surface of the seabed, at or below the sediment-water interface. This evidence suggests the earliest mobile animals inhabited settings with high microbial populations, and may have mined microbially bound sediments for food resources. Here we report the association of mobile animals--insect larvae, oligochaetes and burrowing shore crabs--with microbial mats in a modern hypersaline lagoon in Venezuela. The lagoon is characterized by low concentrations of dissolved O2 and pervasive biomats dominated by oxygen-producing cyanobacteria, both analogous to conditions during the Ediacaran. We find that, during the day, O2 levels in the biomats are four times higher than in the overlying water column. We therefore conclude that the animals harvest both food and O2 from the biomats. In doing so, the animals produce horizontal burrows similar to those found in Ediacaran-aged rocks. We suggest that early mobile animals may have evolved in similar environments during the Ediacaran, effectively exploiting oases rich in O2 that formed within low oxygen settings.