We present an analytical theory of topologically protected photonic states for the two-dimensional Maxwell equations for a class of continuous periodic dielectric structures, modulated by a domain wall. We further numerically confirm the applicability of this theory for three-dimensional structures.