Context. Substituted methanimines and ethylenes have been identified in the interstellar medium. Therefore, allylimine (CH2 =CH–CH=NH) represents a promising candidate for a new interstellar detection. Aims. The goal of the present work is to perform a comprehensive laboratory investigation of the rotational spectrum of allylimine in its ground vibrational state in order to obtain a highly precise set of rest frequencies to assist its search for astronomical sources. Methods. The rotational spectra of the two most stable trans–anti and trans–syn geometrical isomers of allylimine were recorded in the laboratory in the 84–300 GHz frequency interval. Measurements were performed using a source-modulation millimetre-wave spectrometer equipped with a pyrolysis system for the production of unstable species. High-level ab initio calculations were performed to assist the analysis and to obtain reliable estimates for an extended set of spectroscopic parameters. Guided by new laboratory data, allylimine was searched for in space using a sensitive spectral survey of the G+0.693-0.027 molecular cloud, located at the Galactic centre. Results. Almost 1000 rotational transitions have been recorded for trans–anti and trans–syn allylimine. These new data have enabled the determination of a very accurate set of spectroscopic parameters including rotational, quartic and sextic centrifugal distortion con-stants, as well as nuclear quadrupole coupling constants. The improved spectral data allowed us to report a tentative detection for both allylimine isomers in the G+0.693-0.027 molecular cloud, located at the Galactic centre.