Most studies of optimal monetary policy under learning rely on optimality conditions derived for the case when agents have rational expectations. In this paper, we derive optimal monetary policy in an economy where the Central Bank knows, and makes active use of, the learning algorithm agents follow in forming their expectations. In this setup, monetary policy can influence future expectations through its effect on learning dynamics, introducing an additional trade-off between inflation and output gap stabilization. Specifically, the optimal interest rate rule reacts more aggressively to out of equilibrium inflation expectations and noisy cost-push shocks than would be optimal under rational expectations: the Central Bank exploits its ability to "drive" future inflation expectations closer to equilibrium. This optimal policy qualitatively resembles optimal policy when the Central Bank can commit and agents have rational expectations. Moreover, when beliefs are updated according to recursive least squares, the optimal policy is time-varying: after a structural break the Central Bank should be more aggressive and relax the degree of aggressiveness in subsequent periods. The policy recommendation is robust: under our policy the welfare loss if the private sector actually has rational expectations is much smaller than if the Central Bank mistakenly assumes rational expectations whereas in fact agents are learning.JEL classification: C62, D83, D84, E52