Sponges are important members of marine benthic communities, but, in general, little is known about the factors that influence their distribution and abundance. Here we investigated the importance of chemical defence in sponge assemblages from two adjacent shallow subtidal habitats in temperate south-eastern Australia; kelp (Ecklonia radiata) forests and urchin dominated barrens (barrens). Surveys at two sites revealed a disjunct pattern of distribution for sponges between habitats, with ten species of sponge recorded in each habitat, but none occurring in both habitats. The cover of sponge beneath the Ecklonia forest (12.7%) was significantly higher than the cover of sponge in the barrens (2%). Furthermore, sponge assemblages beneath Ecklonia forests consisted of high densities of small colonies, whereas in the barrens, relatively large colonies in low densities predominated. Crude extract of the most abundant encrusting sponges from each habitat was incorporated into an artificial diet and fed to the sea urchin Centrostephanus rodgersii at 50% and/or natural concentrations. Extract of three species of encrusting sponge from the barrens (Chondrilla australiensis, Clathria sp. I and Darwinella australiensis) significantly deterred feeding by C. rodgersii at 50% of their natural concentration. Extract of a fourth barrens species, Pronax sp. I, did not significantly deter feeding at 50% or natural concentration. Feeding by C. rodgersii was similarly not deterred by extracts of four sponge species from the Ecklonia forests at 50% or natural concentrations. Levels of inorganic material in sponges from the two habitats were also investigated. In general, encrusting species of sponge from the barrens had very low percentages (by weight) of inorganic material in their tissue, whereas encrusting sponge species from the Ecklonia forests had very high percentages of inorganic material, ranging from 83% to 93%. This study represents the first experimental test of the effect of sponge extracts on feeding by sea urchins. It reveals differences in sponges from the two habitats and demonstrates an important anti-feedant role for extracts of encrusting sponges from the barrens habitat.