In most of its range, the Spanish sparrow occurs alongside the house sparrow. In such areas, both species breed in farmland and open woodland, with the Spanish sparrow preferring moister habitats. In areas where house sparrows are absent, the Spanish sparrow may live in urban habitats, as in the Canary Islands, Madeira, and some Mediterranean islands. In a few urban areas, such as those in eastern Sardinia, the primary sparrow species is the Eurasian tree sparrow. Before the Spanish sparrow arrived in the Canary Islands and Madeira, the rock sparrow was the sole native sparrow. In the Canaries, the Spanish sparrow occurs in most habitats, having ousted the rock sparrow from all but the driest localities. In Madeira the Spanish sparrow is common in cultivated areas, but it has not fully adapted to nesting in buildings or breeding in the drier north of the island. The Spanish sparrow is not common on most of the Cape Verde islands, due to the presence of the endemic Iago sparrow, and the house sparrow on São Vicente. On Fogo, where it is the sole species of sparrow, it is common in all habitats, breeding both in the houses of São Filipe and on the cliff walls of the volcano Pico do Fogo.