  We demonstrate stable optical microcavities by counteracting the phase
evolution of the cavity modes using an amorphous silicon metasurface as one of
the two cavity end mirrors. Careful design allows us to limit the metasurface
scattering losses at telecom wavelengths to less than 2% and using a
distributed Bragg reflector as metasurface substrate ensures high reflectivity.
Our first demonstration experimentally achieves telecom-wavelength
microcavities with quality factors of up to 4600, spectral resonance linewidths
below 0.4 nm, and mode volumes down to below 2.7$\lambda ^3$. We then show that
the method introduces unprecedented freedom to stabilize modes with arbitrary
transverse intensity profiles and design cavity-enhanced hologram modes. Our
approach introduces the nanoscopic light control capabilities of dielectric
metasurfaces to cavity electrodynamics and is directly industrially scalable
using widespread semiconductor manufacturing processes.
