This is one of the enzymes that catalyzes the last step of the mitochondrial beta-oxidation pathway, an aerobic process breaking down fatty acids into acetyl-CoA. Using free coenzyme A/CoA, catalyzes the thiolytic cleavage of medium- to long-chain 3-oxoacyl-CoAs into acetyl-CoA and a fatty acyl-CoA shortened by two carbon atoms. The activity of the enzyme is reversible and it can also catalyze the condensation of two acetyl-CoA molecules into acetoacetyl-CoA. Thereby, it plays a major role in ketone body metabolism