Let L be a finite-dimensional simple Lie algebra over an algebraically closed field of characteristic p > 3 . It is proved in this paper that if the p-envelope of ad L in Der L contains a torus of maximal dimension whose centralizer in ad L acts nontriangulably on L, then p = 5 and L is isomorphic to one of the Melikian algebras M ( m , n ) . In conjunction with [A. Premet, H. Strade, Simple Lie algebras of small characteristic V. The non-Melikian case, J. Algebra 314 (2007) 664–692, Theorem 1.2], this implies that, up to isomorphism, any finite-dimensional simple Lie algebra over an algebraically closed field of characteristic p > 3 is either classical or a filtered Lie algebra of Cartan type or a Melikian algebra of characteristic 5. This result finally settles the classification problem for finite-dimensional simple Lie algebras over algebraically closed fields of characteristic ≠ 2 , 3 .