Let me specify that my knowledge about Lie groups/algebras is reduced to bits and pieces I learned from various diff geometry textbooks. I could not find a reference for the following question (I am not sure if it is true to start with):
Suppose $G$ is connected compact Lie group. I know that $l=Lie(G)$ splits into a direct product of Lie algebras $[l,l]$ and $z(l)$. If $H \leq G$ is connected such that $Lie(H)=[l,l]$, since $[l,l]$ is semi-simple with negative definite Killing form, an argument using Myers theorem gives that $H$ is a closed(embedded) subgroup of $G$.
Now let $Z \leq G$ such that $Lie(Z)=z(l)$. Clearly $Z$ is Abelian. Can one deduce that $Z$ is also a closed (or embedded) subgroup? Is there a choice of Z that satisfies this? Is it true for all such $Z$?