SN 2008D was discovered following up a bright X-ray transient that exploded in the nearby spiral galaxy NGC 2770 at redshift z = 0.007. We present early spectra (taken 1.75 days after the X-ray transient) which first allowed the identification of this object as a supernova. The early light curve shows a blue, fading excess, due to the envelope cooling after the shock breakout. At later stages, the spectra developed He lines, making the supernova of type Ib. The properties of SN 2008D are different from those of SNe associated with gamma-ray bursts.