This paper reports a combined experimental and numerical study of the flow over a rigid airfoil in flapping motion. The setup consists of a heaving and pitching airfoil at a moderate Reynolds number (Re=500-3600), at a Strouhal number St=0.1. The aim is to assess the accuracy of two-dimensional direct numerical simulations in predicting aerodynamic forces in a flow configuration, which is nominally two-dimensional but is at the verge of three-dimensionality. The assessment is carried out with experiments, including flow field and aerodynamic force measurements with particle image velocimetry and a load cell. The comparative study shows a good qualitative agreement between the experiments and the simulations at comparable Reynolds numbers bo...