A search for dark matter in events with a displaced nonresonant muon pair and missing transverse momentum is presented. The analysis is performed using an integrated luminosity of 138 fb$^{-1}$ of proton-proton (pp) collision data at a center-of-mass energy of 13 TeV produced by the LHC in 2016-2018. No significant excess over the predicted backgrounds is observed. Upper limits are set on the product of the inelastic dark matter production cross section $\sigma$(pp $\to$ A' $\to$$\chi_1$$\chi_2$) and the decay branching fraction $\mathcal{B}$($\chi_2$$\to$$\chi_1 \mu^+ \mu^-$), where A' is a dark photon and $\chi_1$ and $\chi_2$ are states in the dark sector with near mass degeneracy. This is the first dedicated collider search for inelastic dark matter.