The production site of the neutron-rich heavy elements that are formed by rapid neutron capture (the r-process) is still unknown despite intensive research. Here we show detailed studies of a scenario that has been proposed earlier by Lattimer & Schramm, Symbalisty & Schramm, Eichler et al., and Davies et al., namely the merger of two neutron stars. The results of hydrodynamic and full network calculations are combined in order to investigate the relevance of this scenario for r-process nucleosynthesis. Sufficient material is ejected to explain the amount of r-process nuclei in the Galaxy by decompression of neutron star material. Provided that the ejecta consist of matter with a proton-to-nucleon ratio of Ye~0.1, the calculated abundances fit the observed solar r-pattern excellently for nuclei that include and are heavier than the A~130 peak.