Allah's Messenger, tell me about the person who found a man with his wife. The remaining part of the hadith is the same (but) with this addition: They invoked curses in the mosque and I was present there. And he narrated in the hadith: He divorced her with three pronouncements before Allah's Messenger (ﷺ) commanded him (to get separation). He separated from her in the presence of Allah's Apostle (ﷺ), whereupon he said: There is a separation between the invokers of curses.
Sahih Muslim Book 19, Hadith 3