We study international environmental agreements in the presence of a potential climate catastrophe between sovereign countries that are heterogeneous in their exposure to climate change. We do so by analyzing a stochastic game with an absorbing state. The equilibrium structure of this game is very different from the infinitely repeated games that are usually studied in the literature on environmental agreements. In particular, there is no folk theorem that guarantees that the social optimum can be sustained in a Nash equilibrium as long as players are sufficiently patient. However, often, it is feasible to implement an abatement scheme with the same level of aggregate abatement as in the social optimum, but the distribution of abatement among countries is sub-optimal. Moreover, the discount rate has a non-monotonic effect on the optimal environmental agreement.