It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever acts for the sake of Allah while remaining within the Jama'ah and gets it right, Allah accepts it from him; and if he errs, he is forgiven. And whoever acts seeking division and even gets it right, Allah does not accept it from him; and if he errs, let him take his seat in Hell."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12420