The function of ATP5MG (ATP synthase membrane subunit g, ENSG00000167283) is as follows. Subunit g, of the mitochondrial membrane ATP synthase complex (F(1)F(0) ATP synthase or Complex V) that produces ATP from ADP in the presence of a proton gradient across the membrane which is generated by electron transport complexes of the respiratory chain (PubMed:37244256). ATP synthase complex consist of a soluble F(1) head domain - the catalytic core - and a membrane F(1) domain - the membrane proton channel (PubMed:37244256). These two domains are linked by a central stalk rotating inside the F(1) region and a stationary peripheral stalk (PubMed:37244256). During catalysis, ATP synthesis in the catalytic domain of F(1) is coupled via a rotary mechanism of the central stalk subunits to proton translocation (Probable). In vivo, can only synthesize ATP although its ATP hydrolase activity can be activated artificially in vitro (By similarity). Part of the complex F(0) domain (PubMed:37244256). {ECO:0000250|UniProtKB:P19483, ECO:0000269|PubMed:37244256, ECO:0000305|PubMed:37244256}.