Sunan Ibn Majah, Book 36, Hadith 96 (Ibn Majah 4024)

It was narrated from Bara’ bin ‘Azib that the Messenger of Allah (ﷺ) said:

“Allah will curse them and those who curse will curse them.” He said: “The inhabitants of the earth.”