A proximity sensor (12) is provided which comprises a magnet (16) and a sensor (18). The sensor (18) is aligned relative to the magnet (16) in such a manner that the direction (E) of maximum sensitivity of the sensor (18) is formed so as to be substantially parallel to the magnet axis (M) extending through the poles (20, 22) of the magnet (16). Further, an assembly unit (10) is provided.