A molding device that is adapted to mold a metal pipe with a flange , comprising: a first mold and a second mold that are paired with each other; a slide that is adapted to move at least one of the first mold and the second mold ; a drive unit that is adapted to generate a driving force for moving the slide ; a holding section that holds a metal pipe material between the first mold and the second mold ; a control unit that is adapted to control the drive unit and the holding section ; and a gas supply section that is adapted to supply gas into the metal pipe material held by the holding section ; wherein the first mold and the second mold are provided with a first cavity portion (MC) that molds a pipe portion of the metal pipe , and a second cavity portion (SC) that molds a flange portion , wherein the control unit is further adapted to control the gas supply section such that the gas supply section expands and molds the metal pipe material so as to insert a portion of the expanded metal pipe material in the second cavity portion (SC), by supplying gas into the metal pipe material held between the first mold and the second mold by the holding section and to control the drive unit such that the drive unit molds the flange portion by crushing a portion of the expanded metal pipe material in the second cavity portion (SC) of the first mold and the second mold , characterized in that the second cavity portion (SC) communicates with the outside of the molds from the start of molding to the completion of molding of the flange portion . a first mold and a second mold that are paired with each other; a slide that is adapted to move at least one of the first mold and the second mold ; a drive unit that is adapted to generate a driving force for moving the slide ; a holding section that holds a metal pipe material between the first mold and the second mold ; a control unit that is adapted to control the drive unit and the holding section ; and a gas supply section that is adapted to supply gas into the metal pipe material held by the holding section ; wherein the first mold and the second mold are provided with a first cavity portion (MC) that molds a pipe portion of the metal pipe , and a second cavity portion (SC) that molds a flange portion , wherein the control unit is further adapted to control the gas supply section such that the gas supply section expands and molds the metal pipe material so as to insert a portion of the expanded metal pipe material in the second cavity portion (SC), by supplying gas into the metal pipe material held between the first mold and the second mold by the holding section and to control the drive unit such that the drive unit molds the flange portion by crushing a portion of the expanded metal pipe material in the second cavity portion (SC) of the first mold and the second mold , to control the gas supply section such that the gas supply section expands and molds the metal pipe material so as to insert a portion of the expanded metal pipe material in the second cavity portion (SC), by supplying gas into the metal pipe material held between the first mold and the second mold by the holding section and to control the drive unit such that the drive unit molds the flange portion by crushing a portion of the expanded metal pipe material in the second cavity portion (SC) of the first mold and the second mold , characterized in that the second cavity portion (SC) communicates with the outside of the molds from the start of molding to the completion of molding of the flange portion . <EOS>