We address the problem of simultaneous localization and mapping (SLAM) by combining visual loop-closure detection with metrical information given by a robot odometry. The proposed algorithm extends a purely appearance-based loop-closure detection method based on bags of visual words [A. Angeli, D. Filliat, S. Doncieux and J.-A. Meyer, IEEE Transactions On Robotics, Special Issue on Visual SLAM 24 (2008) 1027–1037], which is able to detect when the robot has returned back to a previously visited place. An efficient optimization algorithm is used to integrate odometry information and to generate a consistent topo-metrical map much more usable for global localization and path planning. The resulting algorithm which only requires a monocular camera and robot odometry data, is real-time, incremental (i.e. it does not require any a priori information on the environment), and can be easily embedded on medium platforms.