It is narrated from Sayyiduna Abu Mas'ud (may Allah be pleased with him): "The Messenger of Allah (peace and blessings be upon him) used to pray the witr in the early, the middle and the last part of the night (in every part)."
Abu Dawud al-Tayalisi recorded it, and the wording is his; Abu Bakr bin Abi Shaybah, Ahmad bin Mani', Ahmad bin Hanbal and al-Harith also recorded it, while Abu Ya'la reported this addition at the end of his narration: "So that there may be latitude for the Muslims (in religion); whenever they adopt it (any of these times), there is room for them." The basis of this hadith is in the two Sahihs and elsewhere from the narration of Sayyidah Aishah (may Allah be pleased with her), while this content is narrated in Sahih al-Bukhari from the hadith of Sayyiduna Ibn Umar (may Allah be pleased with them both) and in Ibn Majah from the narration of Sayyiduna Ali bin Abi Talib (may Allah be pleased with him).