We give a full description of the functions F of degree 2 and conductor 1 in the general framework of the extended Selberg class S ♯ . This is performed by means of a new numerical invariant χ F , which is easily computed from the data of the functional equation. We show that the value of χ F gives a precise description of the nature of F , thus providing a sharp form of the classical converse theorems of Hecke and Maass. In particular, our result confirms, in the special case under consideration, the conjecture that the functions in the Selberg class S are automorphic L-functions.