In evolutionary ecology, an ecotype,[note 1] sometimes called ecospecies, describes a genetically distinct geographic variety, population, or race within a species, which is genotypically adapted to specific environmental conditions.
Typically, though ecotypes exhibit phenotypic differences (such as in morphology or physiology) stemming from environmental heterogeneity, they are capable of interbreeding with other geographically adjacent ecotypes without loss of fertility or vigor. 
An ecotype is a variant in which the phenotypic differences are too few or too subtle to warrant being classified as a subspecies. These different variants can occur in the same geographic region where distinct habitats such as meadow, forest, swamp, and sand dunes provide ecological niches. Where similar ecological conditions occur in widely separated places, it is possible for a similar ecotype to occur in the separated locations. An ecotype is different than a subspecies, which may exist across a number of different habitats. In animals, ecotypes owe their differing characteristics to the effects of a very local environment. Therefore, ecotypes have no taxonomic rank.
Ecotypes are closely related to morphs. In the context of evolutionary biology, genetic polymorphism is the occurrence in the equilibrium of two or more distinctly different phenotypes within a population of a species, in other words, the occurrence of more than one form or morph. The frequency of these discontinuous forms (even that of the rarest) is too high to be explained by mutation. In order to be classified as such, morphs must occupy the same habitat at the same time and belong to a panmictic population (whose all members can potentially interbreed). Polymorphism is actively and steadily maintained in populations of species by natural selection (most famously sexual dimorphism in humans) in contrast to transient polymorphisms where conditions in a habitat change in such a way that a "form" is being replaced completely by another.
In fact, Begon, Townsend, and Harper assert that
There is not always clear distinction between local ecotypes and genetic polymorphisms.
The notions "form" and "ecotype" may appear to correspond to a static phenomenon, however; this is not always the case. Evolution occurs continuously both in time and space, so that two ecotypes or forms may qualify as distinct species in only a few generations. Begon, Townsend, and Harper use an illuminating analogy on this:
… the origin of a species, whether allopatric or sympatric, is a process, not an event. For the formation of a new species, like the boiling of an egg, there is some freedom to argue about when it is completed.
Thus ecotypes and morphs can be thought of as precursory steps of potential speciation.
Experiments indicate that sometimes ecotypes manifest only when separated by great spatial distances (of the order of 1,000 km). This is due to hybridization whereby different but adjacent varieties of the same species (or generally of the same taxonomic rank) interbreed, thus overcoming local selection. However other studies reveal that the opposite may happen, i.e., ecotypes revealing at very small scales (of the order of 10 m), within populations, and despite hybridization.
In ecotypes, it is common for continuous, gradual geographic variation to impose analogous phenotypic and genetic variation. This situation is called cline. A well-known example of a cline is the skin color gradation in indigenous human populations worldwide, which is related to latitude and amounts of sunlight. But often the distribution of ecotypes is bimodal or multimodal. This means that ecotypes may display two or more distinct and discontinuous phenotypes even within the same population. Such phenomenon may lead to speciation and can occur if conditions in a local environment change dramatically through space or time.