A hydrogen generation device comprising: a reformer for generating a hydrogen-containing gas using a raw material; a first desulfurization unit for adsorbing and desulfurizing a sulfur compound from the raw material supplied to the reformer; a second desulfurization unit for hydrodesulfurizing the sulfur compound from the raw material supplied to the reformer; a first path used to supply the raw material to the reformer through at least the first desulfurization unit; a second path used to supply the raw material to the reformer through only the second desulfurization unit of the first desulfurization unit and the second desulfurization unit; a switch unit for performing switching between the first path and the second path; a third path used to supply the hydrogen-containing gas generated in the reformer to the second desulfurization unit; a flow control unit (8, 42) which selectively enables or inhibits a flow of the hydrogen-containing gas from an upstream end of the third path toward a downstream end of the third path; and a controller adapted to execute predetermined processing in such a manner that, in at least either a time point before generation of the hydrogen-containing gas is stopped or start-up, and in a state in which the reformer is generating the hydrogen-containing gas, the switch unit is adapted to perform switching to select the first path and the flow control unit (8, 42) is adapted to enable the flow of the hydrogen-containing gas, wherein in the predetermined processing, the controller is adapted to control the flow control unit (8, 42) to initiate the flow of the hydrogen-containing gas when a temperature of the third path reaches a value which is equal to or higher than a temperature at which water condensation in the third path does not occur. a reformer for generating a hydrogen-containing gas using a raw material; a first desulfurization unit for adsorbing and desulfurizing a sulfur compound from the raw material supplied to the reformer; a second desulfurization unit for hydrodesulfurizing the sulfur compound from the raw material supplied to the reformer; a first path used to supply the raw material to the reformer through at least the first desulfurization unit; a second path used to supply the raw material to the reformer through only the second desulfurization unit of the first desulfurization unit and the second desulfurization unit; a switch unit for performing switching between the first path and the second path; a third path used to supply the hydrogen-containing gas generated in the reformer to the second desulfurization unit; a flow control unit (8, 42) which selectively enables or inhibits a flow of the hydrogen-containing gas from an upstream end of the third path toward a downstream end of the third path; and a controller adapted to execute predetermined processing in such a manner that, in at least either a time point before generation of the hydrogen-containing gas is stopped or start-up, and in a state in which the reformer is generating the hydrogen-containing gas, the switch unit is adapted to perform switching to select the first path and the flow control unit (8, 42) is adapted to enable the flow of the hydrogen-containing gas, wherein in the predetermined processing, the controller is adapted to control the flow control unit (8, 42) to initiate the flow of the hydrogen-containing gas when a temperature of the third path reaches a value which is equal to or higher than a temperature at which water condensation in the third path does not occur.