Astrophysical observations indicate that there is roughly five times more dark matter in the Universe than ordinary baryonic matter1, and an even larger amount of the Universe’s energy content is attributed to dark energy2. However, the microscopic properties of these dark components remain unknown. Moreover, even ordinary matter—which accounts for five per cent of the energy density of the Universe—has yet to be understood, given that the standard model of particle physics lacks any consistent explanation for the predominance of matter over antimatter3. Here we present a direct search for interactions of antimatter with dark matter and place direct constraints on the interaction of ultralight axion-like particles (dark-matter candidates) with antiprotons. If antiprotons have a stronger coupling to these particles than protons do, such a matter–antimatter asymmetric coupling could provide a link between dark matter and the baryon asymmetry in the Universe. We analyse spin-flip resonance data in the frequency domain acquired with a single antiproton in a Penning trap4 to search for spin-precession effects from ultralight axions, which have a characteristic frequency governed by the mass of the underlying particle. Our analysis constrains the axion–antiproton interaction parameter to values greater than 0.1 to 0.6 gigaelectronvolts in the mass range from 2 × 10−23 to 4 × 10−17 electronvolts, improving the sensitivity by up to five orders of magnitude compared with astrophysical antiproton bounds. In addition, we derive limits on six combinations of previously unconstrained Lorentz- and CPT-violating terms of the non-minimal standard model extension5.