As the next day dawned, they called loudly upon Baphometh; and we prayed silently in our hearts to God, then we attacked and forced all of them outside the city walls.
"Baphomet" is a corruption of the name Muhammad, which was typically rendered Mahomet in French, which was then rendered as Bafomet, then as Baphomet. During the trial of the Knights Templar in 1307, one of the charges laid against them was idol-worship. Confessions regarding this and the other charges were obtained under torture:
Another piece of information relating to this "idol," which has been the subject of considerable discussion among modern writers, was elicited from the examination of some knights from the south. Gauserand de Montpesant, a knight of Provence, said that their superior showed him an idol made in the form of Baffomet; another, named Raymond Rubei, described it as a wooden head, on which the figure of Baphomet was painted, and adds, "that he worshipped it by kissing its feet, and exclaiming, 'Yalla,' which was," he says, "verbum Saracenorum," a word taken from the Saracens. A templar of Florence declared that, in the secret chapters of the order, one brother said to the other, showing the idol, "Adore this head--this head is your god and your Mahomet." The word Mahomet was used commonly in the middle ages as a general term for an idol or false god; but some writers have suggested that Baphomet is itself a mere corruption of Mahomet, and suppose that the templars had secretly embraced Mahometanism.
In the context of the Templar trials, the accusations of heresy, sodomy, idol-worship, etc. are generally considered to be motivated more by politics than by actual evidence - nearly identical charges were laid out against the Cathars, and there's a similar thread with the witch-trials later on.
Confusion regarding the actual status of the Knights Templar and "Baphomet" worship was made rife beginning in the 19th century, when there was an upsurge in interest in Satanism, occultism, and Freemasonry - with many folks crossing one or more of these interests over. In the 1890s, for example, Léo Taxil famously wrote a hoaxful "history" of Freemasonry that revealed their secret devil-worship, which borrowed A. E. Waite's design for Baphomet (here depicted a goat-headed Satanic figure). Waite debunked Taxil by writing Devil Worship in France (1896)...where he repeats the connection of Freemasonry's connection with the Knights Templar and the Templars' worship of a Baphomet idol. The Templars (and Baphomet) have gone on to star in many a conspiracy theory and work on Satanism and the occult, further muddying the issue.