A grinding machine for grinding an external or internal surface of a cylindrical workpiece, comprising: a grinding wheel; a workpiece support device (20, 30) for rotatably supporting and driving the cylindrical workpiece; a feed device for relatively moving the cylindrical workpiece and the grinding wheel to move the cylindrical workpiece and the grinding wheel toward and away from each other; advance grinding control means (102, 103) for performing an advance grinding in which the grinding wheel is relatively moved in a first direction to be pressed on the cylindrical workpiece to increase a total bending amount value δ(t) which is a total value of a bending amount of the cylindrical workpiece and a bending amount of the grinding wheel; a sizing device for detecting the diameter of the cylindrical workpiece; and a linear scale for detecting the position of the grinding wheel on a corresponding axis; characterized by target bending amount generation means for generating target total bending amount values δ(t) of the cylindrical workpiece and the grinding wheel at respective times t within a rotational range for the cylindrical workpiece to rotate from a present rotational phase θt to a target rotational phase θe in a retraction grinding which is to be performed following the advance grinding in such a way as to relatively move the grinding wheel in a second direction to go away from the cylindrical workpiece as the total bending amount value δ(t) of the cylindrical workpiece and the grinding wheel is decreased; position command value generation means for generating relative position command values X ref (t) at the respective times t of the grinding wheel relative to the cylindrical workpiece based on the target total bending amount values 5(t); and retraction grinding control means (70, S4-S6, 203, 204) for controlling the feed device based on the position command values X ref (t) to execute the retraction grinding. a grinding wheel; a workpiece support device (20, 30) for rotatably supporting and driving the cylindrical workpiece; a feed device for relatively moving the cylindrical workpiece and the grinding wheel to move the cylindrical workpiece and the grinding wheel toward and away from each other; advance grinding control means (102, 103) for performing an advance grinding in which the grinding wheel is relatively moved in a first direction to be pressed on the cylindrical workpiece to increase a total bending amount value δ(t) which is a total value of a bending amount of the cylindrical workpiece and a bending amount of the grinding wheel; a sizing device for detecting the diameter of the cylindrical workpiece; and a linear scale for detecting the position of the grinding wheel on a corresponding axis; characterized by target bending amount generation means for generating target total bending amount values δ(t) of the cylindrical workpiece and the grinding wheel at respective times t within a rotational range for the cylindrical workpiece to rotate from a present rotational phase θt to a target rotational phase θe in a retraction grinding which is to be performed following the advance grinding in such a way as to relatively move the grinding wheel in a second direction to go away from the cylindrical workpiece as the total bending amount value δ(t) of the cylindrical workpiece and the grinding wheel is decreased; position command value generation means for generating relative position command values X ref (t) at the respective times t of the grinding wheel relative to the cylindrical workpiece based on the target total bending amount values 5(t); and retraction grinding control means (70, S4-S6, 203, 204) for controlling the feed device based on the position command values X ref (t) to execute the retraction grinding.