We define a new representation for quantum general relativity, in which exact solutions of the quantum constraints may be obtained. The representation is constructed by means of a noncanonical graded Poisson algebra of classical observables, defined in terms of Ashtekar's new variables. The observables in this algebra are nonlocal and involve parallel transport around loops in a three-manifold Σ. The theory is quantized by constructing a linear representation of a deformation of this algebra. This representation is given in terms of an algebra of linear operators defined on a state space which consists of functionals of sets of loops in Σ. The construction is general and can be applied also to Yang-Mills theories. The diffeomorphism constraint is defined in terms of a natural representation of the diffeomorphism group. The hamiltonian constraint, which contains the dynamics of quantum gravity, is constructed as a limit of a sequence of observables which incorporates a regularization prescription. We give the general solution of the diffeomorphism constraint in closed form. It is spanned by a countable basis which is in one-to-one correspondence with the diffeomorphism equivalence classes of multiple loops, which are a generalization of the link classes studied in knot theory. Then we explicitly construct, in closed form, a large space of solution of the entire set of constraints, including the hamiltonian constraint. These turn out to be classified by the ordinary knot and link classes of Σ. The space of solutions that we find is a sector of the physical states space of nonperturbative quantum general relativity. The failure of perturbation theory is thus shown to be not relevant to the problem of the existence of a nontrivial physical state space in quantum gravity. The relationship between this new loop representation and the self-dual representation of Ashtekar is illuminated by means of a functional transform between states in the two representations. Questions of the completeness of the solution space, the meaning of the physical operators and the physical inner product, are discussed, but not, so far, resolved.