From Sahih Muslim (Hadith 834):
Anas b. Malik reported:(The people) stood up for prayer and the Messenger of Allah (ﷺ) was talking in whispers with a man, and he did not discontinue the conversation till his Companions dozed off; he then came and led the prayer
Reference: Muslim 834