A scale-invariant nonlinear modification of Maxwellian electrodynamics within general relativity is proposed. The starting point is the Mie model and its scale-invariant generalization in flat space-time E4. We prove that all static, spherically symmetrical regular field configurations in this new theory, as well as those in the Mie model, possess negative energy. In search of solitonlike solutions with positive masses, we take into account their proper gravitational fields. We show first that in Riemannian space any gauge-invariant electrodynamic theory does not admit regular solutions. Supposing the gauge invariance to be broken inside the particle, we prove the existence of static particlelike solutions with spherical symmetry and positive energy in the scale-invariant electrodynamics described by a Lagrangian density of the form ℒ = -Y(I)R/(2κ) - W(I)FαβFαβ/2 + 2X(I)RαβAαAβ, with Y, W, and X arbitrary functions of the invariant I = AαAα. The correspondence with the Maxwellian theory is required.