Abstract Background Ranolazine (Ran) is an anti-anginal drug acting as a late sodium current inhibitor at a cell membrane level. Some experimental and clinical studies showed an antihyperglycemic effect of the drug, possibly mediated by the increase of insulin secretion, the inhibition of glucagon release, and the protective action on beta-cell function. These effects, additive to the anti-anginal properties of Ran in patients with chronic coronary syndrome (CCS), could modulate and improve glucose metabolic balance. Indeed, data exploring at a population level the association of the drug with diabetes mellitus (DM) incidence are effectively lacking. Aims Aim of this study was to evaluate in CCS patients if the use of Ran, compared with other treatments (No-Ran), was associated with a lower incidence of DM in an Italian real-world clinical setting. Methods Patients included in the database of the National Health System were evaluated (N=6.1 million; about 10% of the Italian population); the recorded information concerned hospitalizations with the related diseases, clinical events, outpatient visits and drug therapy. Patients hospitalized for any cause and discharged with a diagnosis of angina between 2011 and 2020 (ICD-9-CM codes: 413-414) were included in the study after having proved the absence of DM in their medical history. Study population was divided into the Ran (at least one drug prescription) and in the No-Ran cohorts. The mean follow up was 4.3 years for the Ran and 5.0 years for the No-Ran cohorts, respectively. Results The study population included N=171,015 patients (mean age: 72 years, men: 66%). Among them, N=148,808 (No-Ran cohort) were treated with other therapies while N=22,207 (Ran cohort) received Ran. After propensity score matching, Ran (N=6,384) and No-Ran (N=25,536) cohorts did not differ for age, Charlson comorbidity index, use of aspirin and other antithrombotic agents, statins, beta-blockers, Ca-antagonists and nitrates. The incidence of a new diagnosis of DM during the follow-up period was 10.5 and 15.8% in the Ran and in the No-Ran cohorts, respectively (p<0.001). The Cox-regression analysis showed that Ran therapy was associated with a 30% risk reduction to present a new diagnosis of DM (HR=0.70, 95%CI: 0.64-0.76, p<0.001), independently of age, Charlson comorbidity index, heart failure, previous stroke, use of ivabradine, Ca-antagonists and nitrates. Conclusions This real-world study, performed in a whole subset of the Italian population, showed that, in the long-term, the incidence of a new DM diagnosis was lower in Ran users. This association could contribute to explain the benefits of the drug in patients with CCS.