Mg2C3 was prepared by reaction of Mg dust with n-pentane at approximately 680-degrees-C. A relatively pure product (90% Mg2C3) was obtained with carbon and MgO as impurities. The X-ray pattern of the hydrolyzable part of the sample was indexed on an orthorhombic cell having a = 6.4108 (3) angstrom, b = 5.2786 (2) angstrom, c = 3.7283 (2) angstrom, and Z = 2. Since a:b:c almost-equal-to square-root 3:square-root 2:1, various derivative lattices may be found. The crystal structure solved from powder X-ray and neutron diffraction data is described in space group Pnnm with Mg in 4g [x = 0.2903 (3), y = 0.3901 (4)] and C in 2d and 4g [x = 0.6188 (3), y = 0.2070 (3)]. Mg2C3 represents the first example of a carbide structure having exclusively C3 carbon groups. These units are linear, isoelectronic with CO2, and their C-C distances of 1.332 (2) A are somewhat enhanced due to the pi-interaction with Mg. The bridging of the C-C bonds by Mg is reminiscent of polycenter, electron-deficient bonds.