Seismic reflection profiles and well data are used to determine the Cenozoic stratigraphic and tectonic development of the northern margin of the South China Sea. In the Taiwan region, this margin evolved from a Palaeogene rift to a latest Miocene-Recent foreland basin. This evolution is related to the opening of the South China Sea and its subsequent partial closure by the Taiwan orogeny. Seismic data, together with the subsidence analysis of deep wells, show that during rifting (∼ 58-37 Ma), lithospheric extension occurred simultaneously in discrete rift belts. These belts form a > 200 km wide rift zone and are associated with a stretching factor, β, in the range ∼ 1.4-1.6. By ∼ 37 Ma, the focus of rifting shifted to the present-day continent-ocean boundary off southern Taiwan, which led to continental rupture and initial seafloor spreading of the South China Sea at ∼ 30 Ma. Intense rifting during the rift-drift transition (∼ 37-30 Ma) may have induced a transient, small-scale mantle convection beneath the rift. The coeval crustal uplift (Oligocene uplift of the previously rifted margin, which led to erosion and development of the breakup unconformity, was most likely caused by the induced convection. Oligocene uplift was followed by rapid, early post-breakup subsidence (∼ 30-18 Ma) possibly as the inferred induced convection abated following initial seafloor spreading. Rapid subsidence of the inner margin is interpreted as thermally controlled subsidence, whereas rapid subsidence in the outer shelf of the outer margin was accompanied by fault activity during the interval ∼ 30-21 Ma. This extension in the outer margin (β ∼ 1.5) is manifested in the Tainan Basin, which formed on top of the deeply eroded Mesozoic basement. During the interval ∼ 21-12.5 Ma, the entire margin experienced broad thermal subsidence. It was not until ∼ 12.5 Ma that rifting resumed, being especially active in the Tainan Basin (β ∼ 1.1). Rifting ceased at ∼ 6.5 Ma due to the orogeny caused by the overthrusting of the Luzon volcanic arc. The Taiwan orogeny created a foreland basin by loading and flexing the underlying rifted margin. The foreland flexure inherited the mechanical and thermal properties of the underlying rifted margin, thereby dividing the basin into north and south segments. The north segment developed on a lithosphere where the major rift/thermal event occurred ∼ 58-30 Ma, and this segment shows minor normal faulting related to lithospheric flexure. In contrast, the south segment developed on a lithosphere, which experienced two more recent rift/thermal events during ∼ 30-21 and ∼ 12.5-6.5 Ma. The basal foreland surface of the south segment is highly faulted, especially along the previous northern rifted flank, thereby creating a deeper foreland flexure that trends obliquely to the strike of the orogen.