Over the past century, trees have encroached into grass- and shrublands across western North America. These include Douglas-fir trees (Pseudotsuga menziesii (Mirb.) Franco var. glauca (Beissn.) Franco) encroaching into mountain big sagebrush Nutt. ssp. vaseyana (Rydb.) Beetle) from stable islands of savanna in southwestern Montana. Our objectives were to quantify the relative area occupied by mountain big sagebrush and grasslands versus Douglas-fir savanna in the Fleecer Mountains of southwestern Montana today and in the past, and to identify the historical role of fire and other factors in maintaining this distribution. To do this, we reconstructed a multicentury history of tree establishment and surface fires from 1120 trees sampled on a grid of 50 plots covering 1030 ha of a modern mosaic of sagebrush–grasslands and Douglas-fir trees. We compared these histories to time series of climate and land use, and to spatial variation in topography and soil moisture availability. Beginning in the mid-1800s, Douglas-fir trees established in areas in which trees did not persist historically. In 1855, less than half the plots (42%) had trees whereas today, most plots do (94%). This encroachment was synchronous with the cessation of frequent surface fires, likely caused by the advent of domestic livestock grazing, and perhaps by the start of several decades of relatively dry summers. Douglas-fir savannas historically occurred on fire-safe sites more often than did sagebrush–grass. Our inference that frequent fire excluded Douglas-fir in the past was supported by the results of a simulation model of fire and associated vegetation dynamics. In the continued absence of fire, mountain big sagebrush and grasslands in southwestern Montana are likely to become more homogeneous as Douglas-fir trees continue to encroach.