Context. Circumstellar disc evolution is paramount for the understanding of planet formation. The gas in protoplanetary discs large program (GASPS) aims at determining the circumstellar gas and solid mass around similar to 250 pre-main-sequence Herbig Ae and T Tauri stars. Aims. We aim to understand the origin and nature of the circumstellar matter orbiting 51 Oph, a young ( Methods. We obtained continuum and line observations with the PACS instrument on board the Herschel Space Observatory and continuum data at 1.2 mm with the IRAM 30 m telescope. The spectral energy distribution and line fluxes were modelled using the physico-chemo radiative transfer code ProDiMo to constrain the gas and solid mass of the disc around 51 Oph. The disc vertical hydrostatic structure was computed self-consistently together with the gas thermal balance. Results. We detected a strong emission by atomic oxygen [O I] at 63 microns using the Herschel Space Observatory. The [O I] emission at 145 microns, the [C II] emission at 158 microns, the high-J CO emissions, and the warm water emissions were not detected. Continuum emission was detected at 1.2 mm. The continuum from the near-to the far-infrared and the [O I] emission are well explained by the emission from a compact (R-out = 10-15 AU) hydrostatic disc model with a gas mass of 5 x 10(-6) M-circle dot, 100 times that of the solid mass. However, this model fails to match the continuum millimeter flux, which hints at a cold outer disc with a mass in solids of similar to 10(-6) M-circle dot or free-free emission from a photoevaporative disc wind. This outer disc can either be devoid of gas and/or is too cold to emit in the [O I] line. A very flat extended disc model (R-out = 400 AU) with a fixed vertical structure and dust settling matches all photometric points and most of the [O I] flux. Conclusions. The observations can be explained by an extended flat disc where dust grains have settled. However, a flat gas disc cannot be reproduced by hydrostatic disc models. The low mass of the 51 Oph inner disc in gas and dust may be explained either by the fast dissipation of an initial massive disc or by a very small initial disc mass.