A total of 63 species of aquatic Coleoptera (45) and Heteroptera (18) were collected between 1991 and 1994 from 25 sites in the coastal drainage network of semiarid south-eastern Spain (Murcia Province). The area is drained by ephemeral streams locally known as "ramblas", which are wide, usually dry, channels flowing only in flash-flood events, although in some reaches small permanent or temporary streams, springs, and pools can be formed by either groundwater seepage in the stream bed or by wastewaters from human activities. These waterbodies are often saline (salinity >3 g/l) and suffer from floods and droughts. The studied waterbodies were grouped into four types according to their origin: 1) groundwater-fed habitats, 2) urban wastewaters, 3) agricultural wastewaters, and 4) marine pools. A first ordination of all the sites clearly separated groundwater-fed habitats from wastewaters and marine pools. The two first axes of a second ordination, with only groundwater-fed habitats, showed a strong correlation with salinity, type of aquatic vegetation and water permanence. These variables, particulary salinity, were the major environmental factors explaining species distribution. Finally, most of the species recorded are of biogeographical and/or ecological interest, some being considered as locally endemic.