A method of heat-treating a nitride compound semiconductor layer,
comprising heating a nitride compound semiconductor layer doped with a
p-type impurity at a temperature that is at least 200.degree. C. but less
than 400.degree. C. for at least 100 minutes.