  We prove that a smooth and connected algebraic group $G$ is affine if and
only if any invertible sheaf on any normal $G$-variety is $G$-invariant. For
the proof, a key ingredient is the following result: if $G$ is a connected and
smooth algebraic group and $\mathcal L$ is a $G$-invariant invertible sheaf on
a $G$-variety $X$, then the action of $G$ on $X$ extends to a projective action
on the complete linear ${\mathbb P}(H^0(X,{\mathcal L})$. As an application of
the affineness criterion, we give a new and simple proof of Chevalley-Barsotti
Theorem on the structure of algebraic groups.
