To gain a better understanding of recent experiments on the turbulence-induced melting of a periodic array of vortices in a thin fluid film, we perform a direct numerical simulation of the two-dimensional Navier–Stokes equations forced such that, at low Reynolds numbers, the steady state of the film is a square lattice of vortices. We find that as we increase the Reynolds number, this lattice undergoes a series of nonequilibrium phase transitions, first to a crystal with a different reciprocal lattice and then to a sequence of crystals that oscillate in time. Initially, the temporal oscillations are periodic; this periodic behaviour becoming more and more complicated with increasing Reynolds number until the film enters a spatially disordered nonequilibrium statistical steady state that is turbulent. We study this sequence of transitions using fluid-dynamics measures, such as the Okubo–Weiss parameter that distinguishes between vortical and extensional regions in the flow, ideas from nonlinear dynamics, e.g. Poincaré maps, and theoretical methods that have been developed to study the melting of an equilibrium crystal or the freezing of a liquid and that lead to a natural set of order parameters for the crystalline phases and spatial autocorrelation functions that characterize short- and long-range order in the turbulent and crystalline phases, respectively.