Strong magnetic fields, synchrotron emission, and Compton scattering are omnipresent in compact celestial X-ray sources. Emissions in the X-ray energy band are consequently expected to be linearly polarized. X-ray polarimetry provides a unique diagnostic to study the location and fundamental mechanisms behind emission processes. The polarization of emissions from a bright celestial X-ray source, the Crab, is reported here for the first time in the hard X-ray band (~20-160 keV). The Crab is a complex system consisting of a central pulsar, a diffuse pulsar wind nebula, as well as structures in the inner nebula including a jet and torus. Measurements are made by a purpose-built and calibrated polarimeter, PoGO+. The polarization vector is found to be aligned with the spin axis of the pulsar for a polarization fraction, PF = (20.9 $pm$ 5.0)%. This is higher than that of the optical diffuse nebula, implying a more compact emission site, though not as compact as, e.g., the synchrotron knot. Contrary to measurements at higher energies, no significant temporal evolution of phase-integrated polarisation parameters is observed. The polarization parameters for the pulsar itself are measured for the first time in the X-ray energy band and are consistent with observations at optical wavelengths.