The authors give a new weighted Hilbert inequality for double series as follows: \par Let $\{a_n\}$ and $\{b_n\}$ be two sequences of real numbers. If $\sum_{n=1}^\infty a_n^2<+\infty$, then $$ \multline \left(\sum_{m=1}^\infty\sum_{n=1}^{\infty}\frac{a_mb_n}{m+n}\right)^4\le\pi^4 \left\{\left(\sum_{n=1}^\infty a_n^2\right)^2-\left(\sum_{n=1}^{\infty}\omega(n)a_n^2\right)^2\right\}\\\times \left\{\left(\sum_{n=1}^\infty b_n^2\right)^2-\left(\sum_{n=1}^{\infty}\omega(n)b_n^2\right)^2\right\}, \endmultline $$ where the weight function $\omega(n)$ is defined by $$\omega(n)=\frac{\sqrt n}{n+1}\left(\frac{\sqrt n-1}{\sqrt n+1}-\frac{\ln n}{\pi}\right).$$ \par A similar result for the Hilbert integral inequality is also proved. Some applications are considered.