Petroleum is trapped in the porous layer of limestone or sandstone sandwiched between two non-porous layers.