The greatest source of loss in conventional single-junction photovoltaic cells is their inefficient utilization of the energy contained in the full spectrum of sunlight. To overcome this deficiency, we propose a multijunction system that laterally splits the solar spectrum onto a planar array of single-junction cells with different band gaps. As a first demonstration, we designed, fabricated, and characterized dispersive diffractive optics that spatially separated the visible (360-760 nm) and near-infrared (760-1100 nm) bands of sunlight in the far field. Inverse electromagnetic design was used to optimize the surface texture of the thin diffractive phase element. An optimized thin film fabricated by femtosecond two photon absorption 3D direct laser writing shows an average splitting ratio of 69.5% between the visible and near-infrared light over the 380-970 nm range at normal incidence. The splitting efficiency is predicted to be 80.4% assuming a structure without fabrication errors. Spectral-splitting action is observed within an angular range of +/- 1 degrees from normal incidence. Further design optimization and fabrication improvements can increase the splitting efficiency under direct sunlight, increase the tolerance to angular errors, allow for a more compact geometry, and ultimately incorporate a greater number of photovoltaic band gaps.