Let $X$ be a Hunt process starting from a regular recurrent point 0 and $\nu$ a smooth probability measure on the state space. We show that $T = \inf\{s: A_s > L_s\}$, where $A$ is the continuous additive functional associated to $\nu$ and $L$ the local time at 0, solves the Skorokhod problem for $\nu$, that is, $X_T$ has law $\nu$. We construct another solution which minimizes $\mathbb{E}_0(B_S)$ among all the solutions $S$ of the Skorokhod problem, where $B$ is any positive continuous additive functional. The special case where $X$ is a symmetric Levy process is discussed.