We develop infinitesimally robust statistical procedures for the general diffusion processes. We first prove the existence and uniqueness of the times-series influence function of conditionally unbiased M-estimators for ergodic and stationary diffusions, under weak conditions on the (martingale) estimating function used. We then characterize the robustness of M-estimators for diffusions and derive a class of conditionally unbiased optimal robust estimators. To compute these estimators, we propose a general algorithm, which exploits approximation methods for diffusions in the computation of the robust estimating function. Monte Carlo simulation shows a good performance of our robust estimators and an application to the robust estimation of the exchange rate dynamics within a target zone illustrates the methodology in a real-data application.