The onshore-offshore circulation, equatorward coastal jet and poleward undercurrent associated with coastal upwelling are studied with numerical models. The model ocean has a continental shelf-slope uniform in the longshort direction and is forced by the wind stress with a limited longshore extent. The thermocline intersects the shelf-slope and the internal radius of deformation is smaller than the width of the shelf-slope. This may be a typical situation for coastal upwelling regions such as those off Oregon and northwest Africa. As the initial response to the onset of the winds, the Ekman offshore flow and the compensating onshore flow are induced and the equatorward flow develops over the shelf-slope. When the first mode coastal-trapped wave from the equatorward edge of the forcing region arrives, the onshore compensating flow offshore of the coastal area begins to decrease in strength and eventually offshore flow accompanied by downwelling dominates. Thus, the upwelling tends to be confined to the coastal area. For the alongshore flow, the equatorward flow tends to be confined to the coastal area, and the poloward undercurrent develops below the thermocline over the slope. When the second mode wave arrives, the upwelling is further confined to the coastal area and the equatorward coastal jet and poleward undercurrent cease to develop. Thus, coastal trapped waves, which are neither internal Kelvin nor barotropic shelf waves, play essential roles in determining the upwelling circulation.