Disclosed is a milking robot for teat cup attachment. The milking robot is comprised of a robot arm having a gripper for holding at least one teat cup at a time, an image recording device mounted on the robot arm and provided to record at least one image of the teats of a milking animal and a control device. The control device is provided to control the robot arm to position the teat cup at a teat of the milking animal based on the at least one image of the teats of the milking animal. The image recording device is provided to record at least one image of the hind legs of the milking animal before recording the at least one image of the teats of the milking animal. The control device is provided to, before controlling the robot arm to attach the teat cup to the teat of the milking animal, control the robot arm to move the teat cup between the hind legs of the milking animal from the rear of the milking animal and towards the udder based on the at least one image of the hind legs of the milking animal. The milking robot comprises means for pivoting the image recording device with respect to the gripper of the robot arm between the recording of the at least one image of the hind legs of the milking animal and the recording of the at least one image of the teats of the milking animal.