Osmotic pressures are generated by differences in chemical potential of a solution across a membrane. But whether osmosis can have a significant effect on the pressure of fluids in geological environments has been controversial, because the membrane properties of geological media are poorly understood. 'Anomalous' pressures - large departures from hydrostatic pressure that are not explicable in terms of topographic or fluid-density effects are widely found in geological settings, and are commonly considered to result from processes that alter the pore or fluid volume, which in turn implies crustal changes happening at a rate too slow to observe directly. Yet if osmosis can explain some anomalies, there is no need to invoke such dynamic geological processes in those cases. Here I report results of a nine- year in situ measurement of fluid pressures and solute concentrations in shale that are consistent with the generation of large (up to 20 MPa) osmotic-pressure anomalies which could persist for tens of millions of years. Osmotic pressures of this magnitude and duration can explain many of the pressure anomalies observed in geological settings. The require, however, small shale porosity and large contrasts in the amount of dissolved solids in the pore waters - criteria that may help to distinguish between osmotic and crystal-dynamic origins of anomalous pressures.