A method for manufacturing a device for detecting an electromagnetic radiation, including the following steps: ∘ production, on a substrate, of at least one thermal detector, which is covered by at least one mineral sacrificial layer (14, 15) made of a mineral material capable of being removed by a first chemical etching; ∘ production a through opening extending through the mineral sacrificial layer (14, 15) and opening onto the substrate; ∘ production of a getter portion made of a metal material with a getter effect, disposed on and in contact with the substrate and at a distance from the thermal detector in a plane which is parallel to the substrate; • the getter portion being located in the through opening, at a distance from a lateral border (16.1) defined by the mineral sacrificial layer (14, 15) and delimiting the through opening in the plane which is parallel to the substrate; ∘ production of a carbonaceous sacrificial layer made of a carbonaceous material inert to the first chemical etching and capable of being removed by a second chemical etching, • so as to cover the getter portion and surround it in the plane which is parallel to the substrate, and to completely fill the through opening; ∘ production of a thin encapsulation layer including: an upper portion (31.1) resting on the mineral sacrificial layer and on the carbonaceous sacrificial layer; and a peripheral portion (31.2) extending through the mineral sacrificial layer (14, 15) and surrounding the thermal detector and the getter portion; ∘ removal of the mineral sacrificial layer (14, 15) by the first chemical etching; ∘ removal of the carbonaceous sacrificial layer by the second chemical etching. ∘ production, on a substrate, of at least one thermal detector, which is covered by at least one mineral sacrificial layer (14, 15) made of a mineral material capable of being removed by a first chemical etching; ∘ production a through opening extending through the mineral sacrificial layer (14, 15) and opening onto the substrate; ∘ production of a getter portion made of a metal material with a getter effect, disposed on and in contact with the substrate and at a distance from the thermal detector in a plane which is parallel to the substrate; • the getter portion being located in the through opening, at a distance from a lateral border (16.1) defined by the mineral sacrificial layer (14, 15) and delimiting the through opening in the plane which is parallel to the substrate; • the getter portion being located in the through opening, at a distance from a lateral border (16.1) defined by the mineral sacrificial layer (14, 15) and delimiting the through opening in the plane which is parallel to the substrate; ∘ production of a carbonaceous sacrificial layer made of a carbonaceous material inert to the first chemical etching and capable of being removed by a second chemical etching, • so as to cover the getter portion and surround it in the plane which is parallel to the substrate, and to completely fill the through opening; • so as to cover the getter portion and surround it in the plane which is parallel to the substrate, and to completely fill the through opening; ∘ production of a thin encapsulation layer including: an upper portion (31.1) resting on the mineral sacrificial layer and on the carbonaceous sacrificial layer; and a peripheral portion (31.2) extending through the mineral sacrificial layer (14, 15) and surrounding the thermal detector and the getter portion; ∘ removal of the mineral sacrificial layer (14, 15) by the first chemical etching; ∘ removal of the carbonaceous sacrificial layer by the second chemical etching.