An epoxy resin composition for encapsulating optical semiconductor
element, comprising the following (A) to (D): (A) an epoxy resin
component comprising a novolak type epoxy resin having at least one of
the biphenyl skeleton and naphthalene skeleton in one molecule in an
amount of from 50 to 100% by weight of the total weight of the epoxy
resin component, (B) a curing agent component comprising a novolak type
phenol resin having at least one of the biphenyl skeleton and naphthalene
skeleton in one molecule in an amount of from 50 to 100% by weight of the
total weight of the curing agent component, (C) an organic phosphorus
flame retarder, and (D) a curing catalyst, wherein the content of an
organic phosphorus flame retarder as (C) is from 1.5 to 10% by weight
based on the total weight of the epoxy resin composition.