This paper presents THEMIS measurements of two substorm events to show how the substorm current wedge (SCW) is generated. In the late growth phase when an earthward flow burst in the near-Earth magnetotail brakes and is diverted azimuthally, pressure gradients in the X- and Y-directions are observed to increase in the pileup and diverting regions of the flow. The enhanced pressure gradient in the Y-direction is dawnward (duskward) on the dawnside (duskside) where a clockwise (counter-clockwise) vortex forms. This dawn-dusk pressure gradient drives downward (upward) field-aligned current (FAC) on the dawnside (duskside) of the flow, which, when combined with the FACs generated by the clockwise (counter-clockwise) vortex, forms the SCW. Substorm auroral onset occurs when the vortices appear, Near-Earth dipolarization onset is observed by the THEMIS spacecraft (probes) when a rapid jump in the Y-component of pressure gradient is detected. The total FACs from the vortex and the azimuthal pressure gradient are found to be comparable to the DP-1 current in a typical substorm.