We present a power-spectrum analysis of the final 2dF Galaxy Redshift Survey (2dFGRS), employing a direct Fourier method. The sample used comprises 221 414 galaxies with measured redshifts. We investigate in detail the modelling of the sample selection, improving on previous treatments in a number of respects. A new angular mask is derived, based on revisions to the photometric calibration. The redshift selection function is determined by dividing the survey according to rest-frame colour, and deducing a self-consistent treatment of k-corrections and evolution for each population. The covariance matrix for the power-spectrum estimates is determined using two different approaches to the construction of mock surveys, which are used to demonstrate that the input cosmological model can be correctly recovered. We discuss in detail the possible differences between the galaxy and mass power spectra, and treat these using simulations, analytic models and a hybrid empirical approach. Based on these investigations, we are confident that the 2dFGRS power spectrum can be used to infer the matter content of the universe. On large scales, our estimated power spectrum shows evidence for the ‘baryon oscillations’ that are predicted in cold dark matter (CDM) models. Fitting to a CDM model, assuming a primordial n s = 1 spectrum, h = 0.72 and negligible neutrino mass, the preferred