An input monitoring unit monitors full input light and outputs an input monitor signal. An output monitoring unit monitors full output light and outputs an output monitor signal. An ASE compensating circuit compensates for an ASE component contained in the output monitor signal. A gain-variation-level compensating circuit calculates a target average setup gain that is determined based on a signal intensity of the input monitor signal. A constant gain control circuit performs a gain control based on an output signal from the ASE compensating circuit and the target average setup gain.