Wide-field optical surveys have begun to uncover large samples of fast (t_rise < 5d), luminous (M_peak < -18), blue transients. While commonly attributed to the breakout of a supernova shock into a dense wind, the great distances to the transients of this class found so far have hampered detailed investigation of their properties. We present photometry and spectroscopy from a comprehensive worldwide campaign to observe AT2018cow (ATLAS18qqn), the first fast-luminous optical transient to be found in real time at low redshift. Our first spectra (<2 days after discovery) are entirely featureless. A very broad absorption feature suggestive of near-relativistic velocities develops between 3-8 days, then disappears. Broad emission features of H and He develop after >10 days. The spectrum remains extremely hot throughout its evolution, and the photospheric radius contracts with time (receding below R<10^14 cm after 1 month). This behaviour does not match that of any known supernova, although a relativistic jet within a fallback supernova could explain some of the observed features. Alternatively, the transient could originate from the disruption of a star by an intermediate-mass black hole, although this would require long-lasting emission of highly super-Eddington thermal radiation. In either case, AT2018cow suggests that the population of fast luminous transients represents a new class of astrophysical event. Intensive follow-up of this event in its late phases, and of any future events found at comparable distance, will be essential to better constrain their origins.