An optical element includes a substrate, a surface-emitting type
semiconductor laser above the substrate and including a first mirror, an
active layer and a second mirror formed in this order from the substrate
side, a first optical detection section formed above the substrate, a
second optical detection section above the substrate and having a second
photoabsorption layer, and an isolation layer between the
surface-emitting type semiconductor laser and at least one of the first
optical detection section and the second optical detection section. The
first optical detection section includes a first photoabsorption layer
above the substrate and a photonic crystal section above or below the
first photoabsorption layer. The photonic crystal section has a one or a
two dimensional photonic crystal structure having a periodic refractive
index distribution in a plane that intersects a direction of light
incident upon the first optical detection section.