The invention relates to a light engine (40) comprising: a light-emitting device (30) comprising at least one light source; an optical device (20) attached to the light-emitting device (30); and at least one first magnetic element (25) between the light-emitting device (30) and the optical device (20). The invention relates also to a light device (10) comprising: said light engine (40); and a support holder (50) arranged to bear the light engine (40), comprising a magnetic material adapted such that the at least one first magnetic element (25) of the light engine (40) and this magnetic material are magnetically attracted one to the other to magnetically attach the light engine (40) to the support holder (50).