A device for automatic injection of a product into an injection site, said device having a longitudinal axis and comprising: - a body capable of housing a container, the container being movable relative to said body between an initial position, in which a tip of a needle provided on the container does not extend beyond a distal end of said body, to an insertion position, distally spaced relative to said initial position and in which the tip of the needle extends beyond said distal end of said body; - a safety shield arranged inside the body and receiving at least partially the container, the safety shield being automatically movable with respect to the container and said body between an insertion position, in which the tip of the needle extends beyond a distal end of said safety shield, to a protection position, when the user has removed the device from the injection site, in which the safety shield extends beyond the distal end of said body over a length enough so that the tip of the needle does not extend beyond a distal end of said safety shield; characterized in that said device further comprises: - an external socket receiving the body, having open proximal and distal ends (49, 50), said distal end of the external socket lying substantially in the same plane as the distal end of the body, in the insertion position; - a selection means provided on the external socket, and being movable with respect to said external socket, where said selection means can be placed by a user: - either in a first position, in which the body and the external socket are bound to each other in the axial direction, so that, in the protection position, the safety shield extends beyond the distal end of both said body and said external socket; - or in a second position, in which the external socket is able to move axially in the distal direction with respect to the body, the device being designed so that, in the protection position, both the safety shield and the external socket extend beyond the distal end of said body, substantially over the same length. - a body capable of housing a container, the container being movable relative to said body between an initial position, in which a tip of a needle provided on the container does not extend beyond a distal end of said body, to an insertion position, distally spaced relative to said initial position and in which the tip of the needle extends beyond said distal end of said body; - a safety shield arranged inside the body and receiving at least partially the container, the safety shield being automatically movable with respect to the container and said body between an insertion position, in which the tip of the needle extends beyond a distal end of said safety shield, to a protection position, when the user has removed the device from the injection site, in which the safety shield extends beyond the distal end of said body over a length enough so that the tip of the needle does not extend beyond a distal end of said safety shield; - an external socket receiving the body, having open proximal and distal ends (49, 50), said distal end of the external socket lying substantially in the same plane as the distal end of the body, in the insertion position; - a selection means provided on the external socket, and being movable with respect to said external socket, where said selection means can be placed by a user: - either in a first position, in which the body and the external socket are bound to each other in the axial direction, so that, in the protection position, the safety shield extends beyond the distal end of both said body and said external socket; - or in a second position, in which the external socket is able to move axially in the distal direction with respect to the body, the device being designed so that, in the protection position, both the safety shield and the external socket extend beyond the distal end of said body, substantially over the same length. - either in a first position, in which the body and the external socket are bound to each other in the axial direction, so that, in the protection position, the safety shield extends beyond the distal end of both said body and said external socket; - or in a second position, in which the external socket is able to move axially in the distal direction with respect to the body, the device being designed so that, in the protection position, both the safety shield and the external socket extend beyond the distal end of said body, substantially over the same length.