The inverse conjecture for the Gowers norms U d (V) for finite-dimensional vector spaces V over a finite field ކ asserts, roughly speaking, that a bounded function f has large Gowers norm f U d (V) if and only if it correlates with a phase polynomial φ = e ކ (P) of degree at most d −1, thus P : V → ކ is a polynomial of degree at most d − 1. In this paper, we develop a variant of the Furstenberg correspondence principle which allows us to establish this conjecture in the large characteristic case char ކ d from an ergodic theory counterpart, which was recently established by Bergelson, Tao and Ziegler. In low characteristic we obtain a partial result, in which the phase polynomial φ is allowed to be of some larger degree C(d). The full inverse conjecture remains open in low characteristic; the counterexamples found so far in this setting can be avoided by a slight reformulation of the conjecture.