We report constraints on sub-GeV dark matter particles interacting with electrons from the first underground operation of DAMIC-M detectors. The search is performed with an integrated exposure of 85.23 g days, and exploits the subelectron charge resolution and low level of dark current of DAMIC-M charge-coupled devices (CCDs). Dark-matter-induced ionization signals above the detector dark current are searched for in CCD pixels with charge up to 7e^{-}. With this dataset we place limits on dark matter particles of mass between 0.53 and 1000 MeV/c^{2}, excluding unexplored regions of parameter space in the mass ranges [1.6,1000] MeV/c^{2} and [1.5,15.1] MeV/c^{2} for ultralight and heavy mediator interactions, respectively.