The design and performance of the microfocus spectroscopy beamline at the Diamond Light Source are described. The beamline is based on a 27 mm-period undulator to give an operable energy range between 2 and 20.7 keV, enabling it to cover the K-edges of the elements from P to Mo and the L(3)-edges from Sr to Pu. Micro-X-ray fluorescence, micro-EXAFS and micro-X-ray diffraction have all been achieved on the beamline with a spot size of approximately 3 microm. The principal optical elements of the beamline consist of a toroid mirror, a liquid-nitrogen-cooled double-crystal monochromator and a pair of bimorph Kirkpatrick-Baez mirrors. The performance of the optics is compared with theoretical values and a few of the early experimental results are summarized.