SWIFT J1626.6-5156 is an X-ray pulsar that was discovered in December 2005 during an X-ray outburst. Although the X-ray data suggest that the system is a high-mass X-ray binary, very little information exists on the nature of the optical counterpart. We have analysed all RXTE observations since its discovery, archived optical spectroscopic and photometric data and obtained for the first time near-IR spectra. The K-band spectrum shows HeI 20581 A and HI 21660 A (Brackett-gamma) in emission, which confine the spectral type of the companion to be earlier than B2.5. The H-band spectrum exhibits the HI Br-18-11 recombination series in emission. The most prominent feature of the optical band spectrum is the strong emission of the Balmer line Halpha. The 4000-5000 A spectrum contains HeII and numerous HeI ines in absorption, indicating an early B-type star. The source shows three consecutive stages characterised by different types of variability in the X-ray band: a smooth decay after the peak of a large outburst, large-amplitude flaring variability (reminiscent of type I oytbursts) and quiescence. We observed that the spectrum becomes softer as the flux decreases and that this is a common characteristic of the X-ray emission for all observing epochs. An emission line feature at ~6.5 keV is also always present. The X-ray/optical/IR continuum and spectral features are typical of an accreting X-ray pulsar with an early-type donor. The long-term X-ray variability is also characteristic of hard X-ray transients. We conclude that SWIFT J1626.6-5156 is a Be/X-ray binary with a B0Ve companion located at a distance of ~10 kpc.