This work is concerned with the Lagrangian formulation of electromagnetic fields. Here, the extended Euler-Lagrange differential equation for continuous, nondispersive media is employed. The Lagrangian density for electromagnetic fields is extended to derive all four Maxwell's equations by means of electric and magnetic potentials. For the first time, ohmic losses for time and space variant fields are included. Therefore, a dissipation density function with time dependent and gradient dependent terms is developed. Both, the Lagrangian density and the dissipation density functions obey the extended Euler-Lagrange differential equation. Finally, two examples demonstrate the advantage of describing interacting physical systems by a single Lagrangian density. (C) 2008 Elsevier Ltd. All rights reserved.