Crystals of magnetite (Fe3O4) and periclase (MgO) in Fe-Mg-Ca carbonate in the Martian meteorite Allan Hills 84001 were studied by using transmission electron microscopy to understand their origin and evaluate claims that the magnetites were made by Martian microorganisms. In magnesian carbonate, periclase occurs as aggregates of crystals (grain size 3 nm) that are preferentially oriented with respect to the carbonate lattice. Larger periclase crystals 50 nm in size are commonly associated with voids of similar size. Periclase clearly formed by precipitation from carbonate as a result of partial decomposition and loss of CO2. Magnetite occurs in more ferroan carbonate, and, like periclase, it is associated with voids and microfractures and the two oxides may be intermixed. Magnetite nanocrystals that are commonly euhedral and entirely embedded in carbonate are topotactically oriented with respect to the carbonate lattice, showing that they formed as solid-state precipitates. Magnetites in Fe-rich carbonate rims are not well oriented. These magnetites are generally more irregular in shape and diverse in size than the euhedral variety. All occurrences of magnetite and periclase are entirely consistent with in situ growth by solid-state diffusion as a result of carbonate decomposition during impact heating. Biogenic sources should not be invoked for any magnetites.