A search for decay-time-dependent charge-parity (CP) asymmetry in D 0 → K þ K − and D 0 → π þ π − decays is performed at the LHCb experiment using proton-proton collision data recorded at a center-of-mass energy of 13 TeV, and corresponding to an integrated luminosity of 5.4 fb −1. The D 0 mesons are required to originate from semileptonic decays of b hadrons, such that the charge of the muon identifies the flavor of the neutral D meson at production. The asymmetries in the effective decay widths of D 0 andD 0 mesons are determined to be A Γ ðK þ K − Þ ¼ ð−4.3 AE 3.6 AE 0.5Þ × 10 −4 and A Γ ðπ þ π − Þ ¼ ð2.2 AE 7.0 AE 0.8Þ × 10 −4 , where the uncertainties are statistical and systematic, respectively. The results are consistent with CP symmetry and, when combined with previous LHCb results, yield A Γ ðK þ K − Þ ¼ ð−4.4 AE 2.3 AE 0.6Þ × 10 −4 and A Γ ðπ þ π − Þ ¼ ð2.5 AE 4.3 AE 0.7Þ × 10 −4 .