A method for reducing nitrogen oxide emissions of a bubbling fluidized bed boiler burning biofuel, the method comprising: - supplying at least primary air to a fluidized bed arranged in a lower part of a furnace of the fluidized bed boiler for fluidizing bed material forming the fluidized bed in the furnace, - feeding fuel comprising volatile matter to the fluidized bed, which dries when coming into contact with hot bed material and pyrolizes into pyrolysis gas comprising volatile matter of the fuel, which pyrolysis gas rises upwards in the furnace and burns there, - burning at least a part of carbon residue from the pyrolysis in the fluidized bed with the primary air, - supplying secondary air above the fluidized bed from secondary air nozzles, and - supplying tertiary air above the secondary air nozzles from tertiary air nozzles, characterized by: - supplying, for burning at least a part of the pyrolysis gas, combustion air of volatile matter to the furnace such that the fuel is forced substantially on the surface of the fluidized bed and the fuel comprising volatile matter is pyrolyzed substantially entirely into the pyrolysis gas, wherein the combustion air of volatile matter is supplied to the furnace together with the fuel or parallelly with the fuel, - burning at least a part of the pyrolysis gas in a primary air zone located between an upper part of the fluidized bed and the secondary air nozzles where the air coefficient in relation to the volatile matter in the pyrolysis gas is in the substoichiometric area, wherein the air coefficient in relation to the volatile matter is 0.75 to 0.97 and the total air coefficient in the primary air zone is 0.5 to 0.8, and - burning the pyrolysis gas in a substoichiometric secondary air zone located between the secondary air nozzles and the tertiary air nozzles, wherein the air coefficient in relation to the volatile matter is more than 1 and the total air coefficient is 0.7 to 0.95. - supplying at least primary air to a fluidized bed arranged in a lower part of a furnace of the fluidized bed boiler for fluidizing bed material forming the fluidized bed in the furnace, - feeding fuel comprising volatile matter to the fluidized bed, which dries when coming into contact with hot bed material and pyrolizes into pyrolysis gas comprising volatile matter of the fuel, which pyrolysis gas rises upwards in the furnace and burns there, - burning at least a part of carbon residue from the pyrolysis in the fluidized bed with the primary air, - supplying secondary air above the fluidized bed from secondary air nozzles, and - supplying tertiary air above the secondary air nozzles from tertiary air nozzles, - supplying, for burning at least a part of the pyrolysis gas, combustion air of volatile matter to the furnace such that the fuel is forced substantially on the surface of the fluidized bed and the fuel comprising volatile matter is pyrolyzed substantially entirely into the pyrolysis gas, wherein the combustion air of volatile matter is supplied to the furnace together with the fuel or parallelly with the fuel, - burning at least a part of the pyrolysis gas in a primary air zone located between an upper part of the fluidized bed and the secondary air nozzles where the air coefficient in relation to the volatile matter in the pyrolysis gas is in the substoichiometric area, wherein the air coefficient in relation to the volatile matter is 0.75 to 0.97 and the total air coefficient in the primary air zone is 0.5 to 0.8, and - burning the pyrolysis gas in a substoichiometric secondary air zone located between the secondary air nozzles and the tertiary air nozzles, wherein the air coefficient in relation to the volatile matter is more than 1 and the total air coefficient is 0.7 to 0.95.