Borderline personality disorder (BPD) is a severe and highly prevalent psychiatric disorder, more common in females than in males and with notable differences in presentation between genders. Recent studies have shown that epigenetic modifications such as DNA methylation may modulate gene × environment interactions and impact on neurodevelopment. We conducted an epigenome wide study (Illumina Infinium HumanMethylation450k beadchip) in a group of BPD patients with (N = 49) and without (N = 47) childhood traumas and in a control group (N = 44). Results were confirmed in a replication cohort (N = 293 BPD patients and N = 114 controls) using EpiTYPER assays. Differentially methylated CpG sites were observed in several genes and intragenic regions in the X chromosome (PQBP1, ZNF41, RPL10, cg07810091 and cg24395855) and in chromosome 6 (TAP2). BPD patients showed significantly lower methylation levels in these CpG sites than healthy controls. These differences seemed to be increased by the existence of childhood trauma. Comparisons between BPD patients with childhood trauma and patients and controls without revealed significant differences in four genes (POU5F1, GGT6, TNFRSF13C and FAM113B), none of them in the X chromosome. Gene set enrichment analyses revealed that epigenetic alterations were more frequently found in genes controlling oestrogen regulation, neurogenesis and cell differentiation. These results suggest that epigenetic alterations in the X chromosome and oestrogen-regulation genes may contribute to the development of BPD and explain the differences in presentation between genders. Furthermore, childhood trauma events may modulate the magnitude of the epigenetic alterations contributing to BPD.