During the medieval times an order of Crusader Monks or Knights Templar were tried for heresy, witchcraft and crimes against the Catholic Church. It was at these trials that Baphomet was first described.
No one really knows who Baphomet was although several knights did describe him, under torture, as either a goat, a severed head or an idol possesing 2 heads.