Abstract. We prove that if M is a CW-complex and M 1 is its 1-skeleton, then the crossed module Π 2 (M, M 1 ) depends only on the homotopy type of M as a space, up to free products, in the category of crossed modules, with Π 2 (D 2 , S 1 ). From this it follows that if G is a finite crossed module and M is finite, then the number of crossed module morphisms Π 2 (M, M 1 ) → G can be re-scaled to a homotopy invariant I G (M ), depending only on the algebraic 2-type of M . We describe an algorithm for calculating π 2 (M, M (1) ) as a crossed module over π 1 (M (1) ), in the case when M is the complement of a knotted surface Σ in S 4 and M (1) is the handlebody of a handle decomposition of M made from its 0-and 1-handles. Here, Σ is presented by a knot with bands. This in particular gives us a geometric method for calculating the algebraic 2-type of the complement of a knotted surface from a hyperbolic splitting of it. We prove in addition that the invariant I G yields a non-trivial invariant of knotted surfaces in S 4 with good properties with regard to explicit calculations.