If the Lie algebra is a direct sum, then the Lie group is a direct product?

I am reading the corollary 21.6 in the book "Morse Theory" by John Milnor, but I've encountered a statement for which I have no ideas.

Let $G$ be a simply connected Lie group with a bi-invariant metric and Lie algebra $\mathfrak{g}$. Then $\mathfrak{g}$ splits as $\mathfrak{g'} \oplus \mathfrak{c}$ of Lie algebras, where $\mathfrak{c}$ is the center of $\mathfrak{g}$ and $\mathfrak{g'}$ is the orthogonal complement of $\mathfrak{c}$. The proof of this is easy.

But then Milnor asserts that $G$ splits as a direct product $G' \times G''$ of Lie groups such that the Lie algebras of $G'$ and $G''$ are $\mathfrak{g'}$ and $\mathfrak{c}$ respectively. I have no clue of how to prove it, and the reference provided by Milnor is not useful.

Can anyone give some ideas of the proof or some useful references?

Suppose $G$ and $H$ are Lie groups with Lie algebras $\mathfrak{g}$ and $\mathfrak{h}$ and that $G$ is simply connected. Let $f:\mathfrak{g}\rightarrow \mathfrak{h}$ be a Lie algebra homomorphism. Then, there is a unique $F:G\rightarrow H$ for which $d_e F = f$.
Believing this for a second, note that $G'\times G''$ is a simply connected Lie group as is $G$. Applying the above to the identity map between the two Lie algebras, we get a map $F_1:G\rightarrow G'\times G''$ as well as a map $F_2:G'\times G''\rightarrow G$.
The composition $F_2\circ F_1: G\rightarrow G$ satisfies $d_e(F_2\circ F_2) = Id$, but so does $Id:G\rightarrow G$. By uniqueness above, this implies $F_2\circ F_1 = Id$. Similarly, $F_1\circ F_2$ is the identity, so they are both Lie group isomorphisms.
Given $f:\mathfrak{g}\rightarrow \mathfrak{h}$, consider the graph $\mathfrak{k}=\{(x,f(x))\in \mathfrak{g}\oplus\mathfrak{h}: x\in\mathfrak{g}\}$. Since $f$ is a homomorphism, the graph is a subalgebra. Hence, there is a unique connected subgroup $K$ of $G\times H$ with Lie algebra $\mathfrak{k}$. The projection $\pi_1:G\times H\rightarrow G$, when restricted to $K$ is a covering because $d\pi_1$, when restricted to $\mathfrak{k}$ is the identity. Since $G$ is simply connected, $\pi_1|_{K}$ is an isomorphism between $K$ and $G$. Then the map $\pi_2\circ(\pi_1|_{K})^{-1}: G\rightarrow H$ induces $f$.