We present LM-Reloc -- a novel approach for visual relocalization based ondirect image alignment. In contrast to prior works that tackle the problem witha feature-based formulation, the proposed method does not rely on featurematching and RANSAC. Hence, the method can utilize not only corners but anyregion of the image with gradients. In particular, we propose a lossformulation inspired by the classical Levenberg-Marquardt algorithm to trainLM-Net. The learned features significantly improve the robustness of directimage alignment, especially for relocalization across different conditions. Tofurther improve the robustness of LM-Net against large image baselines, wepropose a pose estimation network, CorrPoseNet, which regresses the relativepose to bootstrap the direct image alignment. Evaluations on the CARLA andOxford RobotCar relocalization tracking benchmark show that our approachdelivers more accurate results than previous state-of-the-art methods whilebeing comparable in terms of robustness.