A ship comprising: a hull having side shells (3A,3B) formed at both sides in athwart ship direction; a first watertight compartment formed at one side in the athwart ship direction in the hull and a portion of which is divided and formed by the side shell of the one side; a second watertight compartment formed at the other side in the athwart ship direction in the hull and a portion of which is divided and formed by the side shell of the other side; a connection section configured to bring the first watertight compartment and the second watertight compartment in connection with each other; an opening/closing valve configured to open and close the connection section; and a control device configured to control the opening and closing of the opening/closing valve, characterized in that the ship comprises a flooding detection sensor arranged to generate a damage generation signal when the hull is damaged and flooding into the hull is detected; and an inclination sensor used to detect a heel angle of the hull or a roll amplitude due to the rolling of the hull; and the control device is configured to switch the opening/closing valve in an open state into a closed state when a predetermined condition is satisfied upon receiving the damage generation signal indicating occurrence of damage to the side shell, and the control device is configured to switch the opening/closing valve into the closed state when the heel angle (θ1) of the hull reaches a predetermined heel angle (θt), and a condition that an elapsed time from reception of the damage generation signal reaches a predetermined setting time or a condition that the hull has a predetermined roll amplitude (θ2) is satisfied as the predetermined condition. a hull having side shells (3A,3B) formed at both sides in athwart ship direction; a first watertight compartment formed at one side in the athwart ship direction in the hull and a portion of which is divided and formed by the side shell of the one side; a second watertight compartment formed at the other side in the athwart ship direction in the hull and a portion of which is divided and formed by the side shell of the other side; a connection section configured to bring the first watertight compartment and the second watertight compartment in connection with each other; an opening/closing valve configured to open and close the connection section; and a control device configured to control the opening and closing of the opening/closing valve, characterized in that the ship comprises a flooding detection sensor arranged to generate a damage generation signal when the hull is damaged and flooding into the hull is detected; and an inclination sensor used to detect a heel angle of the hull or a roll amplitude due to the rolling of the hull; and the control device is configured to switch the opening/closing valve in an open state into a closed state when a predetermined condition is satisfied upon receiving the damage generation signal indicating occurrence of damage to the side shell, and the control device is configured to switch the opening/closing valve into the closed state when the heel angle (θ1) of the hull reaches a predetermined heel angle (θt), and a condition that an elapsed time from reception of the damage generation signal reaches a predetermined setting time or a condition that the hull has a predetermined roll amplitude (θ2) is satisfied as the predetermined condition.