, on a smooth compact Riemannian manifold
, the Q-curvature is a fourth-order invariant involved in the Paneitz operator expression. The present work studies the problem of prescribing the Q-curvature on the standard
-sphere. The main assumption here is that the order
of flatness at critical points of the prescribed Q-curvature satisfies
. The problem has a variational structure, but the lack of compactness does not permit to use standard variational methods. In particular, the problem fails to satisfy the Palais-Smale condition, which is the main difficulty of this problem. The outline of the proof is the following: first, a study of the critical points at infinity of the variational problem; second, the computation of the Morse index of each critical point at infinity; and then, a comparison of the total index with the Euler-Poincaré characteristic of the space of variation. The characterization of the critical points at infinity is obtained through the construction of a suitable pseudo-gradient at infinity. This construction is based on a very delicate expansion of the gradient of the associated Euler-Lagrange functional near infinity. New existence results are obtained through formulas of Euler-Hopf type. The proof gives an upper bound on the Morse index of the obtained solutions and a lower bound on the number of conformal metrics having the same Q-curvature.