A magnetic fastening device for releasably fastening a first unit and a second unit to each other, said first unit having a first unit abutment surface, and said second unit having a second unit abutment surface, said first unit abutment surface and said second unit abutment surface being adapted for abutment against each other, and said magnetic fastening device further comprising at least one pair (110, 112) of magnets (110a, 110b, 112a, 112b), a first magnet (110a, 112a) of said pair (110, 112) of magnets being allocated to the first abutment surface, and a second magnet (110b, 112b) of said pair (110, 112) of magnets being allocated to the second abutment surface, said first magnet (110a, 112a) and said second magnet (110b, 112b) exerting an attractive force to each other, characterized in that a first abutment surface of said first unit abutment surface and said second unit abutment surface is provided with at least one protrusion, wherein a second abutment surface of said first unit abutment surface and said second unit abutment surface is provided with at least one recess, said at least one recess being adapted to receive said at least one protrusion, and wherein said first magnet (110a, 112a) and said second magnet (110b, 112b) are displaced relative to each other by a displacement distance (d) in a displacement direction extending parallel to the extension of said first abutment surface and said second abutment surface at the location of said protrusion and said recess such that, in a state in which said first abutment surface abuts against said second abutment surface and said at least one protrusion is received in said at least one recess, a component (Fo) of said attractive force extending parallel to said first abutment surface and said second abutment surface maintains said at least one protrusion in said at least one recess. said first unit having a first unit abutment surface, and said second unit having a second unit abutment surface, said first unit abutment surface and said second unit abutment surface being adapted for abutment against each other, and said magnetic fastening device further comprising at least one pair (110, 112) of magnets (110a, 110b, 112a, 112b), a first magnet (110a, 112a) of said pair (110, 112) of magnets being allocated to the first abutment surface, and a second magnet (110b, 112b) of said pair (110, 112) of magnets being allocated to the second abutment surface, said first magnet (110a, 112a) and said second magnet (110b, 112b) exerting an attractive force to each other, characterized in that a first abutment surface of said first unit abutment surface and said second unit abutment surface is provided with at least one protrusion, wherein a second abutment surface of said first unit abutment surface and said second unit abutment surface is provided with at least one recess, said at least one recess being adapted to receive said at least one protrusion, and wherein said first magnet (110a, 112a) and said second magnet (110b, 112b) are displaced relative to each other by a displacement distance (d) in a displacement direction extending parallel to the extension of said first abutment surface and said second abutment surface at the location of said protrusion and said recess such that, in a state in which said first abutment surface abuts against said second abutment surface and said at least one protrusion is received in said at least one recess, a component (Fo) of said attractive force extending parallel to said first abutment surface and said second abutment surface maintains said at least one protrusion in said at least one recess.