We develop and estimate a DSGE model for the Brazilian economy, to be used as part of the macroeconomic modeling framework at the Central Bank of Brazil. The model combines the building blocks of standard DSGE models (e.g., price and wage rigidities and adjustment costs) with the following features that better describe the Brazilian economy: (i) a fiscal authority pursuing an explicit target for the primary surplus; (ii) administered or regulated prices as part of consumer prices; (iii) external finance for imports, amplifying the effects of changes in external financial conditions on the economy; and (iv) imported goods used in the production function of differentiated goods. It also includes the presence of financially constrained households. We estimate the model with Bayesian techniques, using data starting in 1999, when inflation targeting was implemented. Model evaluation, based on impulse response functions, moment conditions, variance error decomposition and initial forecasting exercises, suggests that the model can be a useful tool for policy analysis and forecasting.