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) gave the order, and all the doors (of the mosque) were closed except the door of Ali (may Allah be pleased with him).
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12541