  We solve the Dirichlet problem for the quaternionic Monge-Amp\`ere equation
with a continuous boundary data and the right hand side in $L^p$ for $p>2$.
This is the optimal bound on $p$. We prove also that the local integrability
exponent of quaternionic plurisubharmonic functions is two which turns out to
be less than an integrability exponent of the fundamental solution.
