Abstract. Darwin (ESA) and Terrestrial Planet Finder-TPF (NASA) are two projects of space telescopes aiming at the detection of extra-solar terrestrial planets and some of their atmospheric components. In particular, they will be sensitive to the 9.6 µm band of O3 which may be the signature of an O2-rich atmosphere produced by photosynthetic life forms. In this paper, we point out that O2, and hence O3, can also be produced by photochemistry and we investigate the risk of "false positive" detection of life incurred by these missions. For this purpose, we have developed new photochemical and radiative-convective models of terrestrial planet atmospheres. By modelling the photochemistry of some realistic atmospheres, (including present and past Earth and Mars) we show that O2-rich atmospheres (up to 5%) and IR absorbing O3 layers can build up without life from H2O and CO2 photolysis. However, Darwin can still provide a reliable way to detect, through their mid-infrared signatures, ecosystems which have developed oxygenic photosynthesis. Indeed, the two photochemical sources of O2 are shown to interfere with each other; second, when the CO2 pressure is high enough (>50 mbar) to produce appreciable amounts of O2 and O3, it also masks the O3 feature; and third, the by-products of H2O photolysis destroy O3. As a result, whereas the unique detection of O2 remains ambiguous, the simultaneous infrared detection of O3, CO2 and H2O, provided by Darwin, is established to be a robust way to discriminate photochemical O2 production from biological photosynthesis: none of the atmospheres modelled exhibits this "triple signature", even in the most extreme "high risk" cases.