Can all connected locally compact groups be written as a product of abelian and compact subgroups?

Is it true that given a connected locally compact group $G$, there must be abelian subgroups $H_{1},\dots, H_{n}$ and a compact subgroup $K$ of $G$ such that $G$ is homeomorphic to $H_{1}\times H_{2}\times\cdots\times H_{n}\times K$?

If so, can anyone supply a reference?

Any response is greatly appreciated!

• What if I only asked the map $(h_{1},\dots,h_{n},k)\mapsto h_{1}\cdots h_{n}k$ to be a homeomorphism. Are you saying that would work? – roo Nov 24 '16 at 9:16
• It's not obvious to me that if you changed the direct product to semi-direct product, that there wouldn't be such subgroups of the new group which satisfy the statement. – roo Nov 24 '16 at 15:06

For every connected locally compact group $$G$$ there is a maximal compact subgroup $$K$$, and there exists $$d\in\mathbf{N}$$ (unique) such that $$G$$ is homeomorphic to $$\mathbf{R}^d\times K$$. See https://mathoverflow.net/a/140638/14094
So to conclude, it is enough to show that if $$G$$ is not compact, then it has a closed subgroup isomorphic to $$\mathbf{R}$$, and this is standard.