According to various places, we define an algebraic group as a group that is also an algebraic variety (along with some compatibility conditions). Many places also list some examples, one of which is the multiplicative group $\mathbb{G}_m$ of a field $k$.
But $\mathbb{G}_m = \mathbb{A}^1\setminus\{0\}$, which is not Zariski-closed in $\mathbb{A}^1$ (i.e. is not a variety). So how exactly is it an algebraic group? I'm sure there's something really obvious that I've missed, but I'm new to this area and have yet to really get to grasps with such basics.