Water masers are found in dense molecular clouds closely associated with supermassive black holes in the centres of active galaxies. Based upon the understanding of the local water maser luminosity function, it was expected that masers at intermediate and high redshifts would be extremely rare, but galaxies at redshifts z > 2 might be quite different from those found locally, not least because of more frequent mergers and interaction events. Using gravitational lensing as a tool to enable us to search higher redshifts than would otherwise be possible, we have embarked on a survey of lensed galaxies, looking for masers. Here we report the discovery of a water maser at redshift 2.64 in the dust- and gas-rich gravitationally lensed type 1 quasar MG J0414+0534, which, with an isotropic luminosity of 10,000 L_solar, is twice as luminous as the most powerful local water maser, and half that of the most distant maser previously known. Using the locally-determined luminosity function, the probability of finding a maser this luminous associated with any single active galaxy is 10^{-6}. The fact that we saw such a maser in the first galaxy we observed must mean that the volume densities and luminosities of masers are higher at redshift 2.64.