An efficient unsplit perfectly matched layer for numerical simulation of electromagnetic waves in unbounded domains is derived via a complex change of variables. In order to surround a Cartesian grid with the PML, the time-dependent PML requires only one (scalar) auxiliary variable in two space dimensions and six (scalar) auxiliary variables in three space dimensions. It is therefore cheap and straightforward to implement. We use Fourier and energy methods to prove the stability of the PML. We extend the stability result to a semi-discrete PML approximated by central finite differences of arbitrary order of accuracy and to a fully discrete problem for the 'Leap-Frog' schemes. This makes precise the usefulness of the derived PML model for longtime simulations. Numerical experiments are presented, illustrating the accuracy and stability of the PML. © 2013 IMACS.