The story
Alludes to the ancient story of the Trojan horse, a gift for the Trojans which secretly contained Greeks. The prototype of the phrase is found in a Latin phrase in the Aeneid, book 2, lines 48–49: equō nē crēdite, Teucrī. / Quidquid id est, timeō Danaōs et dōna ferentēs. (“Do not trust the horse, Trojans. Whatever it is, I fear the Greeks, even bearing gifts.”)
Etymology from Wiktionary, CC BY-SA 4.0.