Ophthalmology is the branch of medicine specializing in the diagnosis, treatment, and management of diseases and conditions related to the eyes and ocular structures.