Green and Tao’s arithmetic regularity lemma and counting lemma together apply to systems of linear forms which satisfy a particular algebraic criterion known as the ‘flag condition’. We give an arithmetic regularity lemma and counting lemma which apply to all systems of linear forms.