Obesity plays an important role in the development of insulin resistance and diabetes, but the molecular mechanism that links obesity and diabetes is still not completely understood. Here, we used 146 targeted metabolomic profiles from the German KORA FF4 cohort consisting of 1715 participants and associated them with obesity and type 2 diabetes. In the basic model, 83 and 51 metabolites were significantly associated with body mass index (BMI) and T2D, respectively. Those metabolites are branched-chain amino acids, acylcarnitines, lysophospholipids, or phosphatidylcholines. In the full model, 42 and 3 metabolites were significantly associated with BMI and T2D, respectively, and replicate findings in the previous studies. Sobel mediation testing suggests that the effect of BMI on T2D might be mediated via lipids such as sphingomyelin (SM) C16:1, SM C18:1 and diacylphosphatidylcholine (PC aa) C38:3. Moreover, mendelian randomization suggests a causal relationship that BMI causes the change of SM C16:1 and PC aa C38:3, and the change of SM C16:1, SM C18:1, and PC aa C38:3 contribute to T2D incident. Biological pathway analysis in combination with genetics and mice experiments indicate that downregulation of sphingolipid or upregulation of phosphatidylcholine metabolism is a causal factor in early-stage T2D pathophysiology. Our findings indicate that metabolites like SM C16:1, SM C18:1, and PC aa C38:3 mediate the effect of BMI on T2D and elucidate their role in obesity related T2D pathologies.