We formulate a two-parameter generalization of the geometric Langlands correspondence, which we prove for all simply-laced Lie algebras. It identifies the q-conformal blocks of the quantum affine algebra and the deformed W-algebra associated to two Langlands dual Lie algebras. Our proof relies on recent results in quantum K-theory of the Nakajima quiver varieties. The physical origin of the correspondence is the 6d little string theory. The quantum Langlands correspondence emerges in the limit in which the 6d string theory becomes the 6d conformal field theory with (2,0) supersymmetry.