Define r4(N) to be the largest cardinality of a set A⊂{1,…,N} which does not contain four elements in arithmetic progression. In 1998 Gowers proved that \[ r_4(N) \ll N(\log \log N)^{-c}\] for some absolute constant c>0. In 2005, the authors improved this to \[ r_4(N) \ll N e^{-c\sqrt{\log\log N}}.\] In this paper we further improve this to \[ r_4(N) \ll N(\log N)^{-c},\] which appears to be the limit of our methods.