||Gobies (Teleostei: Gobiidae) are an extremely diverse and widely distributed group and are the second most species rich family of vertebrates. Ecological drivers are key to the evolutionary success of the Gobiidae. However, ecological and phylogenetic data are lacking for many diverse genera of gobies. Our study investigated the evolution of microhabitat association across the phylogeny of 18 species of dwarfgobies (genus Eviota), an abundant and diverse group of coral reef fishes. In addition, we also explore the evolution of pectoral fin-ray branching and sensory head pores to determine the relationship between morphological evolution and microhabitat shifts. Our results demonstrate that Eviota species switched multiple times from a facultative hard-coral association to inhabiting rubble or mixed sand/rubble habitat. We found no obvious relationship between microhabitat shifts and changes in pectoral fin-ray branching or reduction in sensory pores, with the latter character being highly homoplasious throughout the genus. The relative flexibility in coral-association in Eviota combined with the ability to move into non-coral habitats suggests a genetic capacity for ecological release in contrast to the strict obligate coral-dwelling relationship commonly observed in closely related coral gobies, thus promoting co-existence through fine scale niche partitioning. The variation in microhabitat association may facilitate opportunistic ecological speciation, and species persistence in the face of environmental change. This increased speciation opportunity, in concert with a high resilience to extinction, may explain the exceptionally high diversity seen in Eviota compared to related genera in the family.