  The main purpose of this paper is to study the generalized Hilbert operator
  {equation*}
  \mathcal{H}_g(f)(z)=\int_0^1f(t)g'(tz)\,dt
  {equation*} acting on the weighted Bergman space $A^p_\om$, where the weight
function $\om$ belongs to the class $\R$ of regular radial weights and
satisfies the Muckenhoupt type condition
  {equation}\label{Mpconditionaabstract}
  \sup_{0\le
r<1}\bigg(\int_{r}^1(\int_t^1\om(s)ds)^{-\frac{p'}{p}}\,dt\bigg)^\frac{p}{p'}
  \int_{0}^r(1-t)^{-p}(\int_t^1\om(s)ds)\,dt<\infty. \tag{\dag}
  {equation} If $q=p$, the condition on $g$ that characterizes the boundedness
(or the compactness) of $\hg: A^p_\om\to A^q_\om$ depends on $p$ only, but the
situation is completely different in the case $q\ne p$ in which the inducing
weight $\om$ plays a crucial role. The results obtained also reveal a natural
connection to the Muckenhoupt type condition \eqref{Mpconditionaabstract}.
Indeed, it is shown that the classical Hilbert operator (the case
$g(z)=\log\frac{1}{1-z}$ of $\H_g$) is bounded from
$L^p_{\int_{t}^1\om(s)\,ds}([0,1))$ (the natural restriction of $A^p_\om$ to
functions defined on $[0,1)$) to $A^p_\om$ if and only if $\om$ satisfies the
condition \eqref{Mpconditionaabstract}. On the way to these results
decomposition norms for the weighted Bergman space $A^p_\om$ are established.
