© The Authors 2016. Published by Oxford University Press on behalf of The Royal Astronomical Society. We revisit the problem of coseismic rupture of the 2008 Mw 7.9 Wenchuan earthquake. Precise determination of the fault structure and slip distribution provides critical information about the mechanical behaviour of the fault system and earthquake rupture. We use all the geodetic data available, craft a more realistic Earth structure and fault model compared to previous studies, and employ a nonlinear inversion scheme to optimally solve for the fault geometry and slip distribution. Compared to a homogeneous elastic half-space model and laterally uniform layered models, adopting separate layered elastic structure models on both sides of the Beichuan fault significantly improved data fitting. Our results reveal that: (1) The Beichuan fault is listric in shape, with near surface fault dip angles increasing from ~36° at the southwest end to ~83° at the northeast end of the rupture. (2) The fault rupture style changes from predominantly thrust at the southwest end to dextral at the northeast end of the fault rupture. (3) Fault slip peaks near the surface for most parts of the fault, with~8.4mthrust and ~5 m dextral slip near Hongkou and ~6 m thrust and ~8.4 m dextral slip near Beichuan, respectively. (4) The peak slips are located around fault geometric complexities, suggesting that earthquake style and rupture propagation were determined by fault zone geometric barriers. Such barriers exist primarily along restraining left stepping discontinuities of the dextralcompressional fault system. (5) The seismic moment released on the fault above 20 km depth is 8.2 × 1021 N m, corresponding to an Mw 7.9 event. The seismic moments released on the local slip concentrations are equivalent to events of Mw 7.5 at Yingxiu-Hongkou, Mw 7.3 at Beichuan-Pingtong, Mw 7.2 near Qingping, Mw 7.1 near Qingchuan, and Mw 6.7 near Nanba, respectively. (6) The fault geometry and kinematics are consistent with a model in which crustal deformation at the eastern margin of the Tibetan plateau is decoupled by differential motion across a decollement in the mid crust, above which deformation is dominated by brittle reverse faulting and below which deformation occurs by viscous horizontal shortening and vertical thickening.