A method for producing an epitaxial layer. First, a structure is fabricated by: formation of an intermediate layer on a donor substrate; and formation of the epitaxial layer on the intermediate layer by epitaxy; with the melting temperature of the intermediate layer being lower than the melting temperature of the epitaxial layer; and then a detachment step for transferring the epitaxial layer from the donor substrate. The detachment step includes applying at least one thermal treatment performed at a temperature of between the melting temperature of the intermediate layer and the melting temperature of the epitaxial layer.