Consider the generalized flag manifold G/B and the corresponding affine flag manifold F G. In this paper we use curve neighborhoods for Schubert varieties in F G to construct certain affine Gromov-Witten invariants of F G, and to obtain a family of 'affine quantum Chevalley' operators Λ0, . . . , Λn indexed by the simple roots in the affine root system of G. These operators act on the cohomology ring H * (F G) with coefficients in Z[q0, . . . , qn]. By analyzing commutativity and invariance properties of these operators we deduce the existence of two quantum cohomology rings, which satisfy properties conjectured earlier by Guest and Otofuji for G = SLn(C). The first quantum ring is a deformation of the subalgebra of H * (F G) generated by divisors. The second ring, denoted QH * aff (G/B), deforms the ordinary quantum cohomology ring QH * (G/B) by adding an affine quantum parameter q0. We prove that QH * aff (G/B) is a Frobenius algebra, and that the new quantum product determines a flat Dubrovin connection. Further, we develop an analogue of Givental and Kim formalism for this ring and we deduce a presentation of QH * aff (G/B) by generators and relations. The ideal of relations is generated by the integrals of motion for the periodic Toda lattice associated to the dual of the extended Dynkin diagram of G.Contents Schubert classes ε 0 , . . . , ε n . The main result of this paper, proved in § 7, is the following.Theorem 1.1. The affine quantum Chevalley operators Λ i satisfy the following properties.(a) The operators Λ i commute up to the imaginary coroot, that is, for any w ∈ W aff and any 0 i, j n we haveThe modified operators Λ i − m i Λ 0 commute (without any additional constraint), that is, for any w ∈ W aff and any 1 i, j n we have