The putative occurrence of methane in the Martian atmosphere has had a major influence on the exploration of Mars, especially by the implication of active biology. The occurrence has not been borne out by measurements of atmosphere by the MSL rover Curiosity but, as on Earth, methane on Mars is most likely in the subsurface of the crust. Serpentinization of olivine-bearing rocks, to yield hydrogen that may further react with carbon-bearing species, has been widely invoked as a source of methane on Mars, but this possibility has not hitherto been tested. Here we show that some Martian meteorites, representing basic igneous rocks, liberate a methane-rich volatile component on crushing. The occurrence of methane in Martian rock samples adds strong weight to models whereby any life on Mars is/was likely to be resident in a subsurface habitat, where methane could be a source of energy and carbon for microbial activity.