Context. The formation of ultra-compact dwarf galaxies (UCDs) is believed to be driven by interaction, and UCDs are abundant in the cores of galaxy clusters, environments that mark the end-point of galaxy evolution. Nothing is known about the properties of UCDs in compact groups of galaxies, environments where most of galaxy evolution and interaction is believed to occur and where UCDs in an intermediate stage in their evolution may be expected. Aims. The main goal of this study is to detect and characterize, for the first time, the UCD population of compact groups of galaxies. For that, two nearby groups in different evolutionary stages, HCG 22 and HCG 90, were targeted. Methods. We selected about 40 UCD candidates from pre-existing photometry of both groups, and obtained spectra of these candidates using the VLT FORS2 instrument in MXU mode. Archival HST/ACS imaging was used to measure their structural parameters. Results. We detect 16 and 5 objects belonging to HCG 22 and HCG 90, respectively, covering the magnitude range −10.0 > M R > −11.5 mag. Their integrated colours are consistent with old ages covering a broad range in metallicities (metallicities confirmed by the spectroscopic measurements). Photometric mass estimates put 4 objects in HCG 90 and 9 in HCG 22 in the mass range of UCDs (>2 × 10 6 M ) for an assumed age of 12 Gyr. These UCDs are on average 2−3 times larger than the typical size of Galactic GCs, covering a range of 2 < ∼ r h < ∼ 21 pc. The UCDs in HCG 22 are more concentrated around the central galaxy than in HCG 90, at the 99% confidence level. They cover a broad range in [α/Fe] abundances from sub-to super-solar. The spectra of 3 UCDs (2 in HCG 22, 1 in HCG 90) show tentative evidence of intermediate age stellar populations. The clearest example is the largest and most massive UCD (∼10 7 M ) in our sample, which is detected in HCG 22. Its properties are most consistent with a stripped dwarf galaxy nucleus. We calculate the specific frequency (S N ) of UCDs for both groups, finding that HCG 22 has about three times higher S N than HCG 90. Conclusions. The ensemble properties of the detected UCDs supports two co-existing formation channels: a star cluster origin (lowluminosity, compact sizes, old ages, super-solar α/Fe), and an origin as tidally stripped dwarf nuclei (more extended and younger stellar populations). Our results imply that the UCDs detected in both groups do not, in their majority, originate from relatively recent galaxy interactions. Most of the detected UCDs have likely been brought into the group along with their host galaxies.