In the 1930s, Wolfgang Krull turned things around and took a radical step: start with any commutative ring, consider the set of its prime ideals, turn it into a topological space by introducing the Zariski topology, and study the algebraic geometry of these quite general objects. Others did not see the point of this generality and Krull abandoned it.
André Weil was especially interested in algebraic geometry over finite fields and other rings. In the 1940s he returned to the prime ideal approach; he needed an abstract variety (outside projective space) for foundational reasons, particularly for the existence in an algebraic setting of the Jacobian variety. In Weil's main foundational book (1946), generic points are constructed by taking points in a very large algebraically closed field, called a universal domain.
Around 1942 Oscar Zariski had defined an abstract Zariski space from the function field of an algebraic variety, for the needs of birational geometry: this is like a direct limit of ordinary varieties (under 'blowing up'), and the construction, reminiscent of locale theory, used valuation rings as points.
In the 1950s, Jean-Pierre Serre, Claude Chevalley and Masayoshi Nagata, motivated largely by the Weil conjectures relating number theory and algebraic geometry, pursued similar approaches with prime ideals as points. According to Pierre Cartier, the word scheme was first used in the 1956 Chevalley Seminar, in which Chevalley was pursuing Zariski's ideas; and it was Martineau who suggested to Serre the move to the current spectrum of a ring in general.
Alexander Grothendieck then gave the decisive definition. He defines the spectrum of a commutative ring as the space of prime ideals with Zariski topology, but augments it with a sheaf of rings: to every Zariski-open set he assigns a commutative ring, thought of as the ring of "polynomial functions" defined on that set. These objects are the "affine schemes"; a general scheme is then obtained by "gluing together" several such affine schemes, in analogy to the fact that projective varieties can be obtained by gluing together affine varieties.
See also the article on spectrum of a ring for a motivation of the paradigm "points are prime ideals".
The generality of the scheme concept was initially criticized: some schemes are removed from having straightforward geometrical interpretation, which made the concept difficult to grasp. However, admitting arbitrary schemes makes the whole category of schemes better-behaved. Moreover, natural considerations regarding, e.g., moduli spaces lead to schemes which are "non-classical".
Subsequent work on algebraic spaces and algebraic stacks by Deligne, Mumford, and Michael Artin, originally in the context of moduli problems, have further enhanced the geometric flexibility of modern algebraic geometry. Grothendieck advocated certain types of ringed toposes as generalisations of schemes, and following his proposals relative schemes over ringed toposes were developed by M. Hakim. Recent ideas about higher algebraic stacks and homotopical or derived algebraic geometry have regard to further expanding the algebraic reach of geometric intuition, bringing algebraic geometry closer in spirit to homotopy theory.
One may think of a scheme as being covered by "coordinate charts" of affine schemes. The above formal definition means exactly that schemes are obtained by glueing together affine schemes for the Zariski topology.
Morphisms from schemes to affine schemes are completely understood in terms of ring homomorphisms by the following contravariant adjoint pair: For every scheme X and every commutative ring A we have a natural equivalence
Since Z is an initial object in the category of rings, the category of schemes has Spec(Z) as final object.
The category of schemes has finite products, but one has to be careful: the underlying topological space of the product scheme of (X, OX) and (Y, OY) is normally not equal to the product of the topological spaces X and Y. In fact, the two are not even the same set in general. For example, if K is the field with nine elements, then Spec K × Spec K ≈ Spec (K ⊗Z K) ≈ Spec (K ⊗Z/3Z K) ≈ Spec (K × K), a set with two elements, though Spec K has only a single element.
For detail on the development of scheme theory, which quickly becomes technically demanding, see first glossary of scheme theory.