We have performed a timing and spectral analysis of the X-ray pulsar SWIFT J1626.6-5156 during a major X-ray outburst in order to unveil its nature and investigate its flaring activity. Epoch- and pulse-folding techniques were used to derive the spin period. Time-average and pulse-phase spectroscopy were employed to study the spectral variability in the flare and out-of-flare states and energy variations with pulse phase. Power spectra were obtained to investigate the periodic and aperiodic variability. Two large flares, with a duration of ~450 seconds were observed on 24 and 25 December 2005. During the flares, the X-ray intensity increased by a factor of 3.5, while the peak-to-peak pulsed amplitude increased from 45% to 70%. A third, smaller flare of duration ~180 s was observed on 27 December 2005. The flares seen in SWIFT J1626.6-5156 constitute the shortest events of this kind ever reported in a high-mass X-ray binary. In addition to the flaring activity, strong X-ray pulsations with Pspin=15.3714+-0.0003 s characterise the X-ray emission in SWIFT J1626.6-5156. After the major outburst, the light curve exhibits strong long-term variations modulated with a 45-day period. We relate this modulation to the orbital period of the system or to a harmonic. Power density spectra show, in addition to the harmonic components of the pulsation, strong band-limited noise with an integrated 0.01-100 Hz fractional rms of around 40% that increased to 64% during the flares. A weak QPO (fractional rms 4.7%) with characteristic frequency of 1 Hz was detected in the non-flare emission. The timing (short X-ray pulsations, long orbital period) and spectral (power-law with cut off energy and neutral iron line) properties of SWIFT J1626.6-5156 are characteristic of Be/X-ray binaries.