that the Prophet (ﷺ) ordered the closing of all the gates, except for the gate of Abu Bakr. And there is a narration on this topic from Abu Sa'eed.
Jami` at-Tirmidhi Book 49, Hadith 74