We use cutting-edge mixed integer optimization (MIO) methods to develop a framework for identification and estimation of structural breaks in time series regressions. The framework requires a transformation of the problem into quadratic programming, which opens up significant advantages for joint estimation. When restated as an $l_0$-penalized regression problem, the method can be compared to the popular $l_1$-penalized regression (LASSO). We show that MIO is capable of finding provably optimal solutions using a well-known optimization solver. The framework permits simultaneous estimation of the number and location of structural breaks as well as regression coefficients, while it accommodates the option of specifying a given or minimal number of breaks. We demonstrate the effectiveness of our approach through extensive numerical experiments obtaining much more accurate estimation of the number of breaks in comparison to popular non-MIO methods. Two empirical applications using US macroeconomic data provide insights into economic dynamics that were not available before.