Time-harmonic electromagnetic field problems in unbounded space may be solved by the finite element method applied inside a sphere which contains the region of interest, providing a suitable boundary condition is imposed on the surface of the sphere. The boundary condition must have the effect of absorbing out-going waves. A new second-order absorbing boundary condition (ABC) is proposed, similar to that introduced by A.E. Peterson, but capable of being incorporated in a variational principle and leading to symmetric finite-element matrices.