Phosphorus is a crucial element in biochemistry, in particular the P−O bond, which is key in the formation of the backbone of deoxyribonucleic acid. So far, PO has only been detected toward the envelope of evolved stars, but never toward star-forming regions. We report the first detection of PO toward two massive star-forming regions, W51 e1/e2 and W3(OH), using data from the IRAM 30 m telescope. PN has also been detected toward the two regions. The abundance ratio PO/PN is 1.8 and 3 for W51 and W3(OH), respectively. Our chemical model indicates that the two molecules are chemically related and are formed via gas-phase ion-molecule and neutralneutral reactions during cold collapse. The molecules freeze out onto grains at the end of the collapse and desorb during the warm-up phase once the temperature reaches ∼35 K. Similar abundances of the two species are expected during a period of ∼5 × 10 4 yr at the early stages of the warm-up phase, when the temperature is in the range 35-90 K. The observed molecular abundances of 10 −10 are predicted by the model if a relatively high initial abundance of 5 × 10 −9 of depleted phosphorus is assumed.