Then this (injunction) was revealed by the verse in Surat an-Nur: "No blame on you whether you eat in company or separately."
When a rich man (after revelation) invited a man from his people to eat food in his house, he would say: I consider it a sin to eat from it, and he said: a poor man is more entitled to it than I. The Arabic word tajannah means sin or fault. It was then declared lawful to eat something on which the name of Allah was mentioned, and it was made lawful to eat the flesh of an animal slaughtered by the people of the Book.
In-book : Book 28, Hadith 18
English translation : Book 27, Hadith 3744