This commentary reviews the current state of knowledge regarding the role of vitamin D in the pathogenesis of diabetes mellitus. In type 1 diabetes mellitus or in adult onset latent autoimmune diabetes (LADA), vitamin D exhibits immunomodulatory actions, influencing the activity of lymphocytes and interleukins. In type 2 diabetes mellitus vitamin D appears to act through different mechanisms, affecting insulin secretion and insulin sensitivity through its effects on the beta cells, mediators of inflammation and parathyroid hormone. Much work remains to be done in this new field of knowledge before the role of vitamin D in the pathogenesis of diabetes mellitus is completely understood.