Imam Al-Nawawi’s Riyad-us-Saliheen
What should one say to the Host if an uninvited Person is accompanied with an
739. Abu Mas`ud Al-Badri (May Allah be pleased with him) reported: A man prepared some food especially for the Prophet (sallallaahu alayhi wa sallam) and invited him along with four others. But a man accompanied him. Having arrived at the door, Messenger of Allah (sallallaahu alayhi wa sallam) said to the host, “This person has followed us. You may allow him, if you like, and if you like he will return.” He said: “O Messenger of Allah, I allow him, too.”
[Al-Bukhari and Muslim].