We study a second order hyperbolic initial-boundary value partial differential equation with memory, that results in an integro-differential equation with a convolution kernel. The kernel is assumed to be either smooth or no worse than weakly singular, that arise e.g., in linear and fractional order viscoelasticity. Existence and uniqueness of the spatial local and global Galerkin approximation of the problem is proved by means of Picard's iteration. Then spatial finite element approximation of the problem is formulated, and optimal order a priori estimates are proved by the energy method. The required regularity of the solution, for the optimal order of convergence, is the same as minimum regularity of the solution for second order hyperbolic partial differential equations. Spatial rate of convergence of the finite element approximation is illustrated by a numerical example.