  We propose a covariant formulation of refracted gravity (RG), a classical
theory of gravity based on the introduction of gravitational permittivity (GP),
a monotonic function of the local mass density, in the standard Poisson
equation. GP mimics dark matter (DM) phenomenology. The covariant formulation
of RG (CRG) that we propose belongs to the class of scalar-tensor theories,
where the scalar field $\varphi$ has a self-interaction potential
$V(\varphi)=-\Xi\varphi$, with $\Xi$ a normalization constant. We show that
$\varphi$ is twice the GP in the weak-field limit. Far from a spherical source
of density $\rho_s(r)$, the transition between the Newtonian and the RG regime
appears below the acceleration scale $a_\Xi=(2\Xi-8\pi G\rho/\varphi)^{1/2}$,
with $\rho=\rho_s+\rho_{bg}$, $\rho_{bg}$ being an isotropic and homogeneous
background. In the limit $2\Xi\gg 8\pi G\rho/\varphi$, we obtain $a_\Xi\sim
10^{-10}$~m~s$^{-2}$. This is comparable to the acceleration $a_0$ originally
introduced in MOND. From CRG, we also derived the modified Friedmann equations
for an expanding, homogeneous, and isotropic universe. We find that the same
scalar field that mimics DM also drives the accelerated expansion of the
Universe. From the stress-energy tensor of $\varphi$, we derived the equation
of state of a redshift-dependent effective dark energy (DE)
$w_{DE}=p_{DE}/\rho_{DE}$. Current observational constraints on $w_{DE}$ and
distance modulus data of SNIa suggest that $\Xi$ has a comparable value to the
cosmological constant $\Lambda$ in the standard model. CRG, therefore, suggests
a natural explanation of the known relation $a_0\sim \Lambda^{1/2}$ and appears
to describe both the dynamics of cosmic structure and the expanding Universe
with a single scalar field, highlighting a possible deep connection between
phenomena currently attributed to DM and DE separately.
