Diagonal loading is one of the most widely used and effective methods to improve robustness of adaptive beamformers. The authors consider its application to the case of steering vector errors, i.e. when there exists a mismatch between the actual steering vector of interest and the presumed one. More precisely, the problem addressed is that of optimally selecting the loading level with a view to maximising the signal-to-interference-plus-noise ratio in the presence of steering vector errors. First, an expression is derived for the optimal loading for a given steering vector error and it is shown that this loading is negative. Next, random steering errors are considered and the optimal loading is averaged with respect to the probability density function of the steering vector errors, yielding a very simple expression for the average optimal loading. Numerical simulations attest to the validity of the analysis and show that diagonal loading with the derived optimal loading factor provides a performance close to optimum.