Let $\{\xi _{1},\xi _{2},\dots \}$ be a sequence of independent random variables (not necessarily identically distributed), and η be a counting random variable independent of this sequence. We obtain sufficient conditions on $\{\xi _{1},\xi _{2},\dots \}$ and η under which the distribution function of the random sum $S_{\eta }=\xi _{1}+\xi _{2}+\cdots +\xi _{\eta }$ belongs to the class of $\mathcal{O}$-exponential distributions.