After a delay control for extending a period from when an engine stop
request is made to when the engine actually stops is started, the
electronic control unit changes the valve timing and the valve duration
of an intake valve to valve timing and valve duration suitable for
starting the engine. When changing the valve timing and the valve
duration after the start of the delay control, the electronic control
unit changes one of the valve timing and the valve duration of the intake
valve based on the other such a valve overlap becomes less than or equal
to a predetermined value.