A controller for an internal combustion engine , the internal combustion engine including: a cylinder ; an intake passage connected to the cylinder ; a water injection valve configured to inject water into the intake passage ; a temperature sensor configured to detect a temperature of intake air flowing through the intake passage ; and an intake valve configured to selectively open and close a connection port between the intake passage and the cylinder , wherein a period from when the intake valve closes to when the intake valve closes again after opening is referred to as a single cycle, and the controller is configured to execute: a water amount calculation process that calculates a water collection amount based on the temperature of the intake air, the water collection amount being an amount of water that collects on a wall surface of the intake passage ; an injection process that causes the water injection valve to inject water when the intake valve is open in the single cycle; and an additional injection process that causes the water injection valve to inject water when the intake valve is closed in the single cycle in addition to the water injection in the injection process in a case in which the water collection amount is less than a specified value that has been defined in advance. a cylinder ; an intake passage connected to the cylinder ; a water injection valve configured to inject water into the intake passage ; a temperature sensor configured to detect a temperature of intake air flowing through the intake passage ; and an intake valve configured to selectively open and close a connection port between the intake passage and the cylinder , wherein a period from when the intake valve closes to when the intake valve closes again after opening is referred to as a single cycle, and the controller is configured to execute: a water amount calculation process that calculates a water collection amount based on the temperature of the intake air, the water collection amount being an amount of water that collects on a wall surface of the intake passage ; an injection process that causes the water injection valve to inject water when the intake valve is open in the single cycle; and an additional injection process that causes the water injection valve to inject water when the intake valve is closed in the single cycle in addition to the water injection in the injection process in a case in which the water collection amount is less than a specified value that has been defined in advance. a water amount calculation process that calculates a water collection amount based on the temperature of the intake air, the water collection amount being an amount of water that collects on a wall surface of the intake passage ; an injection process that causes the water injection valve to inject water when the intake valve is open in the single cycle; and an additional injection process that causes the water injection valve to inject water when the intake valve is closed in the single cycle in addition to the water injection in the injection process in a case in which the water collection amount is less than a specified value that has been defined in advance. <EOS>