We present a fully implicit and discrete energy conserving finite difference scheme for the solution of an initial-boundary value problem of the nonlinear Klein-Gordon equation. A theoretical analysis is performed, and it has been demonstrated that the numerical scheme is particularly attractive when long time solutions are sought. (C) Elsevier Science Inc., 1997.