The objective of this paper is to analyze the monetary and fiscal history of Mexico using a model of the consolidated budget constraint of the Mexican government as the framework. I assume a small open economy in which the government exports oil. I study the period 1960-2016. I evaluate the ability of the model to explain the crises of 1982 and 1994, and while the model can explain the 1982 debt crisis, it cannot explain the 1994 crisis. A constitutional change in the relationship between the federal government and Banco de México, and policy choices made in the aftermath of the 1994 crisis, are consistent with a transition from fiscal dominance to an independent Central Bank. Inflation fell persistently after 1995, reaching values of 3% per year in mid-2016. That number is the target of the Central Bank. After a long transition following the 1982 crisis, Mexico succeeded in controlling inflation. I discuss forces that reduced inflation over time: a long sequence of primary surpluses, the constitutional change that gave independence and a goal to the Central Bank, and the current inflation targeting regime. On the fiscal side, I observe a change in the downward trend of the total debt-to-GDP ratio, as it fell from the 1980s to 2009, the year in which it started growing persistently until 2016.