-At high population densities, the amphibious and herbivorous mudskipperBoleophthalmus boddarti construct mud walls around their territories as a means of reducing aggression between neighbours. Because of the walls, territories contain pools of water and exposed mud slopes. Whilst the density of benthic diatom prey was highly variable, the highest was found on the exposed mud slopes and the lowest on the boundary walls. Fish grazed mainly on the mud slopes. There were no significant differences in diatom density between territorial and non-territorial areas or between grazed and non-grazed areas within territories. The variation of the diatom density, however, was reduced within territories. The mud walls are considered to play a secondary, indirect role in maintaining populations of diatoms within territories.