The 2-type of a topological space is determined by the first k-invariant $\kappa^3\in H^3(\pi_1(X),\pi_2(X))$. For a triple $(G,A, \kappa)$ (where G is a group, A is a G-module and $\kappa:G\to A$ is a 3-cocycle) and a G-module B we introduce a new cohomology theory $_2H^n(G,A, \kappa;B)$ which we call the secondary cohomology. We give a construction that associates to a pointed topological space $(X, x_0)$ an invariant $_2\kappa^4\in \, _2H^4(\pi_1(X), \pi_2(X), \kappa^3; \pi_3(X))$. This construction can be seen a 3-type generalization of the classical k-invariant. We also present the relation with the Eilenberg-MacLane space $K(A,2)$.