Background phase correction is necessary to correctly quantify flow velocity values from 2D phase-contrast MR images. However, typically used static tissue correction is susceptible to wrap-around resulting in even larger quantification errors. In this work, we successfully implemented a robust and automatic background phase correction algorithm based on M-estimate Sample Consensus (MSAC). MSAC achieves robust results over wide ranges of its few parameters. Based on 49 phase-contrast time series with and without wrap-around, MSAC reduced the average root-mean-squared error from 1.71±0.34cm/s (static fit correction) to 0.78±0.07cm/s (MSAC) in presence of wrap-around.