According to a conjecture attributed to Polya and Hilbert, there is a self-adjoint operator whose eigenvalues are the the nontrivial zeros of the Riemann zeta function. We show that the near-horizon dynamics of a massive scalar field in the Schwarzschild black hole spacetime, under a reasonable boundary condition, gives rise to energy eigenvalues that coincide with the Riemann zeros. In achieving this result, we exploit the Bekenstein conjecture of black hole area quantization, and argue that it is responsible for the breaking of the continuous scale symmetry of the near horizon dynamics into a discrete one.