An engine controller according to one aspect of the invention is applied to a cylinder injection engine including a fuel injection' valve that directly injects fuel into a cylinder. The engine controller determines whether knocking is occurring based on a signal from a knocking sensor. When the knocking is occurring, the engine controller performs partial lift fuel injection at a predetermined timing close to an ignition timing. The partial lift fuel injection is performed with a lift amount of a valve body of the fuel injection valve limited within a range between a minimum lift amount (0) and a partial lift amount, which is smaller than a maximum lift amount.