In this work we present a new approach to two - dimensional robust spline smoothing. The proposed method is based on M-estimator algorithms but unlike in other M-estimator based imageprocessing algorithms it takes into consideration spatial relations between picture elements. The contribution of the sample to the model depends not only on the current residual of that sample, but also on the neighboring residuals. The smoothing parameter (A) is estimated separately for each processing window and it adapts to the local structure of the image. In order to test the proposed algorithm we a p ply it to image filtering problem. We show that the filter based on our algorithm has excellent detail preserving properties while suppressing additive Gaussian and impulsive noise very efficiently.