A robust estimator for functional autoregressive models is proposed, the Depth-based Least Squares (DLS) estimator. The DLS estimator down-weights the influence of outliers by using the functional directional outlyingness as a centrality measure. It consists of two steps: identifying the outliers with a two-stage functional boxplot, then down-weighting the outliers using the functional directional outlyingness. Theoretical properties of the DLS estimator are investigated such as consistency and boundedness of its influence function. Through a Monte Carlo study, it is shown that the DLS estimator performs better than estimators based on Principal Component Analysis (PCA) and robust PCA, which are the most commonly used. To illustrate a practical application, the DLS estimator is used to analyze a dataset of ambient CO concentrations in California.