Sunan Ibn Majah, Book 7, Hadith 140 (Ibn Majah 1777)

It was narrated that Anas bin Malik said:

“The Messenger of Allah (ﷺ) said: ‘The person observing I’tikaf may attend funerals and visit the sick.’”