A controller for an internal combustion engine, the controller being employed for the internal combustion engine, the internal combustion engine comprising a port injection valve that injects fuel into an intake passage, the controller being configured to execute: selecting and executing one of two processes, a multiple injection process and a single injection process, wherein the multiple injection process is to sequentially execute an intake air synchronous injection and an intake air non-synchronous injection by operating the port injection valve in order from the intake air non-synchronous injection to the intake air synchronous injection, the intake air synchronous injection is to inject fuel in synchronization with an opening period of an intake valve, the intake air non-synchronous injection is to inject fuel at a timing that is more advanced than a timing of the intake air synchronous injection, and the single injection process is to execute only the intake air non-synchronous injection by operating the port injection valve, wherein a majority of a fuel injection period of the single injection process is prior to an opening timing of the intake valve; an advancement process for setting, when switching the fuel injection process from the single injection process to the multiple injection process, an injection start timing (Ins) of the intake air non-synchronous injection to be more advanced than an injection start timing of the single injection process prior to the switching; a required injection amount calculation process for calculating a required injection amount (Qd) used to control an air-fuel ratio (Af) to a target air-fuel ratio based on an amount (η) of fresh air filling a combustion chamber of the internal combustion engine, and the multiple injection process includes a process for splitting the required injection amount (Qd) into an injection amount (Qs) of the intake air synchronous injection and an injection amount (Qns) of the intake air non-synchronous injection. selecting and executing one of two processes, a multiple injection process and a single injection process, wherein the multiple injection process is to sequentially execute an intake air synchronous injection and an intake air non-synchronous injection by operating the port injection valve in order from the intake air non-synchronous injection to the intake air synchronous injection, the intake air synchronous injection is to inject fuel in synchronization with an opening period of an intake valve, the intake air non-synchronous injection is to inject fuel at a timing that is more advanced than a timing of the intake air synchronous injection, and the single injection process is to execute only the intake air non-synchronous injection by operating the port injection valve, wherein a majority of a fuel injection period of the single injection process is prior to an opening timing of the intake valve; the multiple injection process is to sequentially execute an intake air synchronous injection and an intake air non-synchronous injection by operating the port injection valve in order from the intake air non-synchronous injection to the intake air synchronous injection, the intake air synchronous injection is to inject fuel in synchronization with an opening period of an intake valve, the intake air non-synchronous injection is to inject fuel at a timing that is more advanced than a timing of the intake air synchronous injection, and the single injection process is to execute only the intake air non-synchronous injection by operating the port injection valve, wherein a majority of a fuel injection period of the single injection process is prior to an opening timing of the intake valve; an advancement process for setting, when switching the fuel injection process from the single injection process to the multiple injection process, an injection start timing (Ins) of the intake air non-synchronous injection to be more advanced than an injection start timing of the single injection process prior to the switching; a required injection amount calculation process for calculating a required injection amount (Qd) used to control an air-fuel ratio (Af) to a target air-fuel ratio based on an amount (η) of fresh air filling a combustion chamber of the internal combustion engine, and the multiple injection process includes a process for splitting the required injection amount (Qd) into an injection amount (Qs) of the intake air synchronous injection and an injection amount (Qns) of the intake air non-synchronous injection.