A two-dimensional two-layer model for wind-driven transient coastal upwelling is formulated. The momentum equations include the turbulent dynamics and the time-dependent and nonlinear terms in both the cross- and along-shore directions. The continuity and heat equations allow mass and heat turbulent transfer between both layers. The integral form of the momentum, continuity and heat equations are closed using a two-regime parameterization for the entrainment velocity. In the first regime, corresponding to the early stages of upwelling, the interface quickly raises due to flux divergence near the coast. The entrainment velocity is small (0.1-1 m day −1, largely produced through K raus and T urner's [(1967) Tellus, 19, 98–106] slow erosion of the thermocline, and it is estimated using N iiler and K raus' [(1977) In: Modelling and prediction of the upper layers of the ocean, Pergamon Press, Oxford, pp. 143–172] parameterization. When the bulk Richardson number ( Ri) becomes close to its critical value then we switch to the second regime, during which we calculate the entrainment velocity from the continuity equation under the condition that Ri remains near-critical, i.e. the equivalent of P ollard et al. [(1973) Geophysical Fluid Dynamics, 4, 381–404] stability criterion for the upper ocean. The entrainment velocity quickly becomes large (several m h −1), the interface deepens and stratification is eroded. The existence of this regime is supported by observations of persistent near-critical gradient Richardson numbers ( Ri g ) during coastal upwelling [J ohnson (1981) In: Coastal upwelling, American Geophysical Union, Washington, DC., pp. 79–86; J ohnson et al. (1976) Journal of Physical Oceanography, 6, 556–574; K undu and B eardsley, (1991) Journal of Geophysical Research, 96, 4855–4868]. Our model is applied to several initial temperature differences between the surface and bottom layers, with the upper layer depth and forcing parameters realistically chosen. The dynamically important mixing regime corresponds to the second regime, with effective shear-induced mixing being produced through a strong baroclinic coastal jet. A realistic front, formed between the well-mixed water near the coast and lighter offshore surface water, propagates away from the coast. The offshore waters are characterized by the presence of inertial oscillations, overlying the Ekman flow. The inertial oscillations are too weak to produce any significant mixing, but a comparison with de S zoeke and R ichman's [(1984) Journal of Physical Oceanography, 14, 364–377] semigeostrophic model (modified to include the shear-mixing regime) shows that they are important enough to exert some control on the horizontal volume flux divergence near the coast. A relatively fast internal Poincare wave, propagating from the coast, has the effect of slowly dampening the inertial oscillations. The results are in good qualitative agreement with early observations by J ohnson et al. (1976).