We present results from the development of a high-pressure xenon gas time projection chamber (TPC). This detector was constructed as a prototype for the experiment NEXT - Neutrino Experiment with a Xenon TPC - and aims to demonstrate the feasibility of using high-pressure xenon as a medium for a detector searching for neutrinoless double beta decay. Proof of the existence of this rare decay would have several major implications in fundamental physics including lepton number violation and the existence of Majorana neutrinos, and would provide information about neutrino masses, including the nature of the neutrino mass hierarchy and some indication of the absolute mass scale of the lightest neutrino. We show that good energy resolution (1 percent FWHM at 662 keV) can be achieved in high-pressure xenon using an electroluminescent gain mechanism. We also discuss the possibilities of using high-pressure xenon as a detector medium in dark matter searches.