In chlorophyll biosynthesis, insertion of Mg2+ into protoporphyrin IX is catalysed in an ATP-dependent reaction by a three-subunit (BchI, BchD and BchH) enzyme magnesium chelatase. In this work we present the three-dimensional structure of the ATP-binding subunit BchI. The structure has been solved by the multiple wavelength anomalous dispersion method and refined at 2.1 Å resolution to the crystallographic R-factor of 22.2% (Rfree = 24.5%). It belongs to the chaperone-like "ATPase associated with a variety of cellular activities" (AAA) family of ATPases, with a novel arrangement of domains: the C-terminal helical domain is located behind the nucleotide-binding site, while in other known AAA module structures it is located on the top. Examination by electron microscopy of BchI solutions in the presence of ATP demonstrated that BchI, like other AAA proteins, forms oligomeric ring structures. Analysis of the amino acid sequence of subunit BchD revealed an AAA module at the N-terminal portion of the sequence and an integrin I domain at the C terminus. An acidic, proline-rich region linking these two domains is suggested to contribute to the association of BchI and BchD by binding to a positively charged cleft at the surface of the nucleotide-binding domain of BchI. Analysis of the amino acid sequences of BchI and BchH revealed integrin I domain-binding sequence motifs. These are proposed to bind the integrin I domain of BchD during the functional cycle of magnesium chelatase, linking porphyrin metallation by BchH to ATP hydrolysis by BchI. An integrin I domain and an acidic and proline-rich region have been identified in subunit CobT of cobalt chelatase, clearly demonstrating its homology to BchD. These findings, for the first time, provide an insight into the subunit organisation of magnesium chelatase and the homologous colbalt chelatase.