We consider the influence of countries' external security environments on their military spending. We first estimate the ex ante probability that a country will become involved in a fatal militarized interstate dispute using a model of dyadic conflict that incorporates key elements of liberal and realist theories of international relations. We then estimate military spending as a function of the threat of armed interstate conflict and other influences: arms races, the defense expenditures of friendly countries, actual military conflict, democracy, civil war, and national economic output. In a panel of 165 countries, 1950 to 2000, we find our prospectively generated estimate of the external threat to be a powerful variable in explaining military spending. A 1 percentage point increase in the aggregate probability of a fatal militarized dispute, as predicted by our liberal-realist model, leads to a 3 percent increase in a country's military expenditures.