  We generalize the theory of the second invariant cohomology group $H^2_{\rm
inv}(G)$ for finite groups $G$, developed in [Da2,Da3,GK], to the case of
affine algebraic groups $G$, using the methods of [EG1,EG2,G]. In particular,
we show that for connected affine algebraic groups $G$ over an algebraically
closed field of characteristic $0$, the map $\Theta$ from [GK] is bijective
(unlike for some finite groups, as shown in [GK]). This allows us to compute
$H^2_{\rm inv}(G)$ in this case, and in particular show that this group is
commutative (while for finite groups it can be noncommutative, as shown in
[GK]).
