An optical element includes a substrate, a columnar section that is formed
above the substrate and has an upper surface for light emission or light
incidence, a first protection layer formed above the substrate in a
region including at least a circumference of the columnar section, a
resin layer formed above the first protection layer, a second protection
layer formed above the resin layer, and an electrode that is electrically
connected to the upper surface of the columnar section, wherein the first
and second protection layers are composed of a material harder than the
resin layer.