Background: Electroconvulsive Therapy (ECT) is one of the most effective treatments for major depressive disorder (DEP). There is recently increasing attention to evaluate ECT's effect on resting-state functional magnetic resonance imaging (rs-fMRI). This study aims to compare rs-fMRI of DEP patients with healthy participants, investigate whether dynamic functional network connectivity network (dFNC) estimated from rs-fMRI predicts the ECT outcome, and explore the effect of ECT on brain network states. Method: Resting-state fMRI data were collected from 119 patients with depression or DEP (76 females), and 61 Healthy (HC) participants (34 females) with an age mean of 52.25 (N=180) years old. The pre-ECT and post-ECT Hamilton Depression Rating Scale (HDRS) were 25.59+/-6.14 and 11.48+/-9.07, respectively. Twenty-four independent components from default mode (DMN) and cognitive control network (CCN) were extracted using group-independent component analysis from pre-ECT and post-ECT rs-fMRI. Then, the sliding window approach was used to estimate the pre-and post-ECT dFNC of each participant. Next, k-means clustering was separately applied to pre-ECT dFNC and post-ECT dFNC to assess three distinct states from each participant. We calculated the amount of time each individual spends in each state, called occupancy rate or OCR. Next, we compared OCR values between HC and DEP participants. We also calculated the partial correlation between pre-ECT OCRs and HDRS change while controlling for age, gender, number of treatment, and site. Finally, we evaluated the effectiveness of ECT by comparing pre-and post-ECT OCR of DEP and HC participants. Results: The main findings include: 1) DEP patients had significantly lower OCR values than the HC group in a state, where connectivity between CCN and DMN was relatively higher than other states (corrected p= 0.015), 2) Pre-ECT OCR of state, with more negative connectivity between CCN and DMN components, predicted the HDRS changes (R=0.23 corrected p=0.03). This means that those DEP patients who spend less time in this state showed more HDRS change, and 3) The post-ECT OCR analysis suggested that ECT increased the amount of time DEP patients spend in state 2 (corrected p=0.03). Finally, we found ECT increases the total traveled distance in DEP. Conclusion: Our finding suggests that dFNC features, estimated from CCN and DMN, show promise as a predictive biomarker of the ECT outcome of DEP patients. Also, this study identified a possible underlying mechanism associated with the ECT effect in DEP patients.