Inclusion Criteria:  Participant is able to provide consent. Diagnosis of major depressive disorder (MDD) according to DSM-V criteria. During the current episode, treatment-resistant MDD (at least one failed pharmacological trial of adequate dose and duration) For the MDD group with comorbid borderline personality disorder (BPD): diagnosis of BPD according to the Diagnotic Statistical Manual V (DSM-V) criteria. For healthy controls: no psychiatric or neurological illness.  Exclusion Criteria:  For the MDD group without BPD: BPD diagnosis The participant does not fulfill requirements for iTBS treatment according to safety guidelines. The participant does not fulfill requirements for MRI measurements according to safety guidelines. Pregnancy or breast-feeding. Acute suicidality. Neurological illness (e.g. dementia, Parkinson's disease, chorea huntington, multiple sclerosis). increased current risk for epileptic seizure. comorbid diagnosis of schizophrenia or psychotic symptoms, bipolar disorder, and substance use disorder within the last 6 months. Conditions related to increased intracranial pressure. Brain injury or stroke.