Abstract. Recall that a topological group G is: (a) σ-compact if G = {Kn : n ∈ N} where each Kn is compact, and (b) compactly generated if G is algebraically generated by some compact subset of G. Compactly generated groups are σ-compact, but the converse is not true: every countable nonfinitely generated discrete group (for example, the group of rational numbers or the free (Abelian) group with a countable infinite set of generators) is a counterexample. We prove that a metric group G is compactly generated if and only if G is σ-compact and for every open subgroup H of G there exists a finite set F such that F ∪ H algebraically generates G. As a corollary, we obtain that a σ-compact metric group G is compactly generated provided that one of the following conditions holds: (i) G has no proper open subgroups, (ii) G is dense in some connected group (in particular, if G is connected itself), (iii) G is totally bounded (= subgroup of a compact group). Our second major result states that a countable metric group is compactly generated if and only if it can be generated by a sequence converging to its identity element (eventually constant sequences are not excluded here). Therefore, a countable metric group G can be generated by a (possibly eventually constant) sequence converging to its identity element in each of the cases (i), (ii) and (iii) above. Examples demonstrating that various conditions cannot be omitted or relaxed are constructed. In particular, we exhibit a countable totally bounded group which is not compactly generated.If G is a group and X ⊆ G, then we use X to denote the smallest subgroup of G which contains X. A set X algebraically generates G if G = X . Recall that a topological group G is:n ∈ N} where each K n is compact, and (ii) compactly generated if G = K for some compact subset K of G.Obviously, each compactly generated group is σ-compact. The converse is not true in general: any countable nonfinitely generated discrete group (for example, the group of rational numbers or the free (Abelian) group with a countable infinite set of generators) is a counterexample. However, Pestov [15] established that every σ-compact topological group is topologically isomorphic to a closed subgroup of some compactly generated group.