We study the long-time behavior of non-negative, finite-energy solutions to the initial value problem for the Porous Medium Equation with variable density, i.e. solutions of the problem \begin{eqnarray*} \rho (x) \partial_{t} u = \Delta u^{m}, \quad in \quad Q:= R^n \times R_+, u(x,0)=u_{0}(x), \quad in\quad R^n, \end{eqnarray*} where $m>1$, $u_0\in L^1(R^n, \rho(x)dx)$ and $n\ge 3$. We assume that $\rho (x)\sim C|x|^{-2}$ as $|x|\to\infty$ in $R^n$. Such a decay rate turns out to be critical. We show that the limit behavior can be described in terms of a family of source-type solutions of the associated singular equation $|x|^{-2}u_t = \Delta u^{m}$. The latter have a self-similar structure and exhibit a logarithmic singularity at the origin.