A method of controlling a wavelength-tunable laser, where the wavelength-tunable laser has a gain region, a first wavelength selection portion, and a second wavelength selection portion, the first wavelength selection portion having a wavelength characteristic with periodic wavelength peaks, the second wavelength selection portion having a wavelength characteristic with periodic wavelength peaks, the period of which are different from those of the first wavelength selection portion and further comprising at least one heater (30a, 30b, 30c); the wavelength peaks of the second wavelength selection portion being controlled by a controller in accordance with a change in refractive index caused by the at least one heater, the oscillation wavelength of the wavelength-tunable laser being obtained by overlapping the wavelength peaks in the characteristic of the first wavelength selection portion and the wavelength peaks in the characteristic of the second wavelength selection portion, and a wavelength characteristic of the oscillation wavelength having a plurality of terraces, each terrace corresponding to a temperature range over which the oscillation wavelength is constant when a temperature of the second wavelength selection portion is changed by the at least one heater in a single direction, the method comprising a case where a setting value to be set on the at least one heater of the second wavelength selection portion is controlled in a process in which the oscillation wavelength is changed from a first wavelength to a second wavelength, the method performing: a first step of determining a control direction indicative of a changing direction of the setting value of the at least one heater of the second wavelength selection portion in a case where the setting value is changed from a first setting value for achieving the first wavelength to a second setting value for achieving the second wavelength; a second step of setting a preferred direction as being a predetermined changing direction of the setting value and comparing it with the control direction as determined in the first step; a third step of setting a setting value defined as a prepared setting value that is shifted from the second setting value in a direction that is opposite to the pre-determined changing direction as determined in the second step when the control direction determined in the first step is opposite to the pre-determined changing direction; and a fourth step of changing the prepared setting value set in the second step to the second setting value. a first step of determining a control direction indicative of a changing direction of the setting value of the at least one heater of the second wavelength selection portion in a case where the setting value is changed from a first setting value for achieving the first wavelength to a second setting value for achieving the second wavelength; a second step of setting a preferred direction as being a predetermined changing direction of the setting value and comparing it with the control direction as determined in the first step; a third step of setting a setting value defined as a prepared setting value that is shifted from the second setting value in a direction that is opposite to the pre-determined changing direction as determined in the second step when the control direction determined in the first step is opposite to the pre-determined changing direction; and a fourth step of changing the prepared setting value set in the second step to the second setting value.