The 13 November 2016 Kaikoura earthquake occurred in the northeastern coastal region of the South Island, New Zealand. The Mw 7.8 mainshock generated a complex pattern of surface ruptures, and was followed within about 12 hours by three moderate shocks of Mw ≥ 6.0. Here we use teleseismic waveforms to invert for the source rupture of the Kaikoura earthquake. The resulting slip-distribution model exhibits insignificant slip near the hypocenter and three pockets of major slip zones with distinct senses of motion. The mainshock started from a rupture near the hypocenter, grew into thrust on shallow crustal faults ~50 km northeast of the hypocenter, and then developed into two slip zones: a deeper one with oblique thrust and a shallower one with almost purely right-lateral strike-slip. Locations of the thrust and strike-slip motions in the slip-distribution model agree well with reported coastal uplifts and horizontal offsets. The overall slip pattern is dominated by horizontal motion, especially at shallow depth, due to the partitioning of thrust and strike-slip motions above the subduction zone megathrust. Aftershock distribution suggests that most aftershocks tend to occur near the edges of the major slip zones of the mainshock. This observation on aftershock locations may provide useful information for seismic hazard assessments after large earthquakes.