Objective: to analyze records of hospitalizations due to mental and behavioral disorders before and after the beginning of the covid-19 pandemic in Brazil, from January 2008 to July 2021. Methods: this was a descriptive ecological interrupted time series study, using secondary data retrieved from the Brazilian National Health System Hospital Information System; a time series analysis of hospitalizations was conducted based on a population-weighted Poisson regression model; relative risk (RR) and respective 95% confidence intervals (95%CI) were calculated. Results: we identified 6,329,088 hospitalizations due to mental and behavioral disorders; hospitalization rates showed an 8% decrease (RR = 0.92; 95%CI 0.91;0.92) after the start of the pandemic, compared to the pre-pandemic period. Conclusion: the pandemic changed the trend of hospitalizations due to mental and behavioral disorders in Brazil; the drop observed in the period is evidence that the pandemic affected the mental health care network.