Sunan Abi Dawud, Book 14, Hadith 154 (Abu Dawud 2467)

Abu Hurairah said:

The Prophet (ﷺ) used to observe I'tikaf during ten days of Ramadan every year. But when the year in which he died, he observed I'tikaf for twenty days.