A structural characterization of the simple Lie algebras of generalized Cartan type over fields of prime characteristic