  Let $ 0\le f\in C^{0,1}(\mathbb R^n)$. Given a domain $\Omega\subset \mathbb
R^n$, we prove that any stable solution to the equation $-\Delta u=f(u)$ in
$\Omega$ satisfies a BMO interior regularity when $n=10$, and an Morrey
$M^{p_n,4+2/(p_n-2)}$ interior regularity when $n\ge 11$, where
$$p_n=\frac{2(n-2\sqrt{n-1}-2)}{n-2\sqrt{n-1}-4}. $$
  This result is optimal as hinted by earlier results, and answers an open
question raised by Cabr\'e, Figalli, Ros-Oton and Serra. As an application, we
show a sharp Liouville property: Any stable solution $u \in C^2(\mathbb R^n)$
to $-\Delta u=f(u)$ in $\mathbb R^n$ satisfying the growth condition, i.e.\
$|u(x)|= o\left( \log|x| \right)$ as $|x|\to+\infty$ when $n=10$; or $|u(x)|=
o\left( |x| ^{ -\frac n2+\sqrt{n-1}+2 }\right)$ as $x|\to+\infty$ when $n\ge
11$, must be a constant. This extends the well-known Liouville property for
radial stable solutions obtained by Villegas.
