At the end of Surah al-Kahf, but Hammam said: At the beginning of Surah al-Kahf.

Sahih Muslim Book 6, Hadith 312