We derive a mathematical model of an electromagnetic (EM) field generated by tsunamigenic seabed deformation over an ocean of constant depth. We solve the governing Maxwell equations for the EM field, coupled with a potential flow model of Cauchy-Poisson type for the transient fluid motion forced by seabed deformation. Our new model advances previous studies, where simplified formulae without direct forcing were assumed for the wave field. Using complex integration and large-time asymptotics, we obtain a novel analytical solution for the magnetic field propagating at large distance from the seabed deformation in two dimensions. We show that this magnetic field is made of two terms, one proportional to an Airy function, and thus propagating similarly to the surface gravity wave, and one proportional to a Scorer function, which exhibits a phase lag with respect to the surface gravity wave. Such a phase lag explains the time difference between the arrival of the EM field and the surface gravity wave generated by seabed deformation, which were observed in recent measurements and numerical results. Finally, we discuss the opportunity to detect EM fields as precursors of surface gravity waves in tsunami early warning systems. We introduce a novel non-dimensional parameter to identify the propagation regime of the magnetic field, i.e. self-induction versus diffusion-dominated. We show that tsunami early warning via EM field is possible for diffusion-dominated regimes when the water depth is less than 2 km. Our findings provide a rigorous analytical explanation of existing observations and numerical results.