Commensal, phoretic relalionship and other types of associations of Diptera and land crabs are known from various parts of the world. A commensal relationship between an unidentified species of Sphaeroceridae (Diptera) and Cardisoma crassum Smith (Crustacea: Gecarcinidae) from Cocos Island, Costa Rica, is reported for the first time. The pattern of infection is closely similar to that of Drosophila and Lissocephala (Diptera: Drosophilidae) found associated with other gecarcinids elsewhere. The Sphaeroceridae are apparently obligatorily exploiting an exclusive niche in the restricted environment, suggesting a genetical mechanism of adaptation for this particular group of Diptera, possibly derived and favored by geographical isolation.