A full Rietveld refinement, based on high-resolution synchrotron powder diffraction data, was undertaken to investigate the structural features of a pure sample of as-synthesized SAPO-40 (space group: P112/n; a = 21.9410 angstrom, b = 13.6912 angstrom, c = 14.2486 angstrom, gamma = 90.0-degrees; chemical formula: [(Si, Al, P)64 O128].4 TPAOH). The fine structural details have been correlated with other experimental data obtained by thermal analysis and C-13, Al-27 and Si-29 NMR. The topology proposed previously for the AFR framework structure of SAPO-40, with 12- and 8-ring channels intersecting to form a two-dimensional system, has been confirmed. Refined atomic coordinates for both the framework atoms and the organic template (tetrapropylammonium ion) are presented. The latter is located in the 12-ring channels with the N-atom near the center of the saddle-shaped 12-ring. The terminal methyl groups of the propyl chains are quite rigidly confined in two different framework environments. The possible interaction of the template with some framework Al atoms is discussed and the heterogeneous distribution of Si throughout the structure is shown.