p97, an abundant hexameric ATPase of the AAA family, is involved in homotypic membrane fusion. It is thought to disassemble SNARE complexes formed during the process of membrane fusion. Here, we report two structures: a crystal structure of the N-terminal and D1 ATPase domains of murine p97 at 2.9 Å resolution, and a cryoelectron microscopy structure of full-length rat p97 at 18 Å resolution. Together, these structures show that the D1 and D2 hexamers pack in a tail-to-tail arrangement, and that the N domain is flexible. A comparison with NSF D2 (ATP complex) reveals possible conformational changes induced by ATP hydrolysis. Given the D1 and D2 packing arrangement, we propose a ratchet mechanism for p97 during its ATP hydrolysis cycle.