A microelectromechanical device comprising a mobile rotor which lies in a horizontal device plane in its rest position, wherein the mobile rotor is configured to undergo linear and/or rotational out-of-plane motion, and a fixed stator which lies in the horizontal device plane adjacent to the mobile rotor, and the device further comprises a fixed wall (171, 271, 371) which defines a wall plane which is adjacent to the horizontal device plane, wherein the fixed wall is separated from the mobile rotor in a vertical direction by a rotor-wall gap, wherein the vertical direction is perpendicular to the horizontal device plane, and the device further comprises a motion limiter and a counter-structure, wherein the motion limiter comprises a stopper element (16, 26, 36), and the counter-structure is adjacent to the horizontal device plane and separated from the horizontal device plane in a vertical direction, and the stopper element and the counter-structure are separated by a vertical stopper gap (284, 384) when the mobile rotor is in the horizontal device plane, and when the mobile rotor undergoes motion in the vertical direction toward the fixed wall, the device brings the stopper element into contact with the counter-structure across the stopper gap before the mobile rotor comes into contact with the fixed wall across the rotor-wall gap, characterized in that either - the mobile rotor is a first device part (11, 21) and the fixed stator is a second device part, or - the mobile rotor is a second device part (12, 32) and the fixed stator is a first device part, and an edge of the first device part is separated from an edge of the second device part in the horizontal device plane by a rotor-stator gap which extends in a transversal direction, and the motion limiter extends from the first device part (11, 21) to the second device part (12, 32) across the rotor-stator gap, and the motion limiter comprises a torsionally flexible first attachment section (14, 24, 34) which extends from the edge of the first device part (11, 21) in the transversal direction toward the second device part, and a stopper lever (13, 23, 33) which is attached to the first attachment section (14, 24, 34), and a first side of said stopper lever extends in a first side direction from the first attachment section (14, 24, 34), and a second side of said stopper lever extends in a second side direction from the first attachment section (14, 24, 34), wherein the second side direction is opposite to the first side direction, and the stopper lever (13, 23, 33) comprises the stopper element (16, 26, 36) on its second side, and the motion limiter further comprises a torsionally flexible connecting section (15, 25, 35) which extends from the edge of the second device part to the first side of said stopper lever (13, 23. 33). and the device further comprises a motion limiter and a counter-structure, wherein the motion limiter comprises a stopper element (16, 26, 36), and the counter-structure is adjacent to the horizontal device plane and separated from the horizontal device plane in a vertical direction, and the stopper element and the counter-structure are separated by a vertical stopper gap (284, 384) when the mobile rotor is in the horizontal device plane, and when the mobile rotor undergoes motion in the vertical direction toward the fixed wall, the device brings the stopper element into contact with the counter-structure across the stopper gap before the mobile rotor comes into contact with the fixed wall across the rotor-wall gap, characterized in that either - the mobile rotor is a first device part (11, 21) and the fixed stator is a second device part, or - the mobile rotor is a second device part (12, 32) and the fixed stator is a first device part, - the mobile rotor is a first device part (11, 21) and the fixed stator is a second device part, or - the mobile rotor is a second device part (12, 32) and the fixed stator is a first device part, and an edge of the first device part is separated from an edge of the second device part in the horizontal device plane by a rotor-stator gap which extends in a transversal direction, and the motion limiter extends from the first device part (11, 21) to the second device part (12, 32) across the rotor-stator gap, and the motion limiter comprises a torsionally flexible first attachment section (14, 24, 34) which extends from the edge of the first device part (11, 21) in the transversal direction toward the second device part, and a stopper lever (13, 23, 33) which is attached to the first attachment section (14, 24, 34), and a first side of said stopper lever extends in a first side direction from the first attachment section (14, 24, 34), and a second side of said stopper lever extends in a second side direction from the first attachment section (14, 24, 34), wherein the second side direction is opposite to the first side direction, and the stopper lever (13, 23, 33) comprises the stopper element (16, 26, 36) on its second side, and the motion limiter further comprises a torsionally flexible connecting section (15, 25, 35) which extends from the edge of the second device part to the first side of said stopper lever (13, 23. 33).