Recently, cutting planes derived from maximal lattice-free convex sets have been studied intensively by the integer programming community. An important question in this research area has been to decide whether the closures associated with certain families of lattice-free sets are polyhedra. For a long time, the only result known was the celebrated theorem of Cook, Kannan and Schrijver who showed that the split closure is a polyhedron. Although some fairly general results were obtained by Andersen, Louveaux and Weismantel [An analysis of mixed integer linear sets based on lattice point free convex sets, Math. Oper. Res. 35, (2010) pp. 233--256], some basic questions have remained unresolved. For example, maximal lattice-free triangles are the natural family to study beyond the family of splits and it has been a standing open problem to decide whether the triangle closure is a polyhedron. In this paper, we resolve this by showing that the triangle closure is indeed a polyhedron, and its number of facets can be bounded by a polynomial in the size of the input data.