A detailed study of the Hourglass nebula in the M8 star-forming region is presented. The study is mainly based on recent subarcsec-resolution JHKs images taken at Las Campanas Observatory and complemented with archival Hubble Space Telescope (HST) images and long-slit spectroscopy retrieved from the European Southern Observatory Archive Facility. Using the new numerical code chorizos, we estimate the distance to the earliest stars in the region to be 1.25 kpc. Infrared photometry of all the sources detected in the field is given. From analysis of the JHKs colour-colour diagrams, we find that an important fraction of these sources exhibit significant infrared excess. These objects are candidates to be low- and intermediate-mass pre-main-sequence stars. Based on HST observations, the spatial distribution of gas, dust and stars in the region is analysed. A morphological analysis of these images also reveals a rich variety of structures related to star formation (proplyds, jets, bow shocks), similar to those observed in M16 and M42, along with the detection of the first four Herbig-Haro objects in the region. Furthermore, a long-slit spectrum obtained with the New Technology Telescope confirms the identification of one of them (HH 870) in the core of the Hourglass nebula, providing the first direct evidence of active star formation by accretion in M8.