Every finite group G has a normal series each of whose factors either is soluble or is a direct product of nonabelian simple groups. We define the nonsoluble length λ(G) as the number of nonsoluble factors in a shortest series of this kind. Upper bounds for λ(G) appear in the study of various problems on finite, residually finite, and profinite groups. We prove that λ(G) is bounded in terms of the maximum 2-length of soluble subgroups of G, and that λ(G) is bounded by the maximum Fitting height of soluble subgroups. For an odd prime p, the non-p-soluble length λ p (G) is introduced, and it is proved that λ p (G) does not exceed the maximum p-length of p-soluble subgroups. We conjecture that for a given prime p and a given proper group variety V the non-p-soluble length λ p (G) of finite groups G whose Sylow p-subgroups belong to V is bounded. In this paper we prove this conjecture for any variety that is a product of several soluble varieties and varieties of finite exponent. As an application of the results obtained, an error is corrected in the proof of the main result of the second author’s paper Multilinear commutators in residually finite groups, Israel Journal of Mathematics 189 (2012), 207–224.