Who was the Muslim leader who proved to be the undoing of the European crusaders in palestine?

There were eight crusades (seven of them more or less in Palestine), but the most famous Muslim was the Kurdish-born Sultan of Egypt Yusef ibn Ayyub (which is to say, "Joseph, the son of Job" styled Salah ed-Din (or Glory of the Faith), better known in the West as "Saladin."

Saladin was opposed by the English leader, Richard Plantagenet, styled Cour de Leon or "Lionheart" who he didn't exactly "undo," but at least prevented from taking the city of Jerusalem. Saladin's greatest victory was against a Crusader relief column which had imprudently started across the hot summer country without water. Saladin's forces trapped them on some low hills, known as the "Horns of Hattin" on July 4.

Saladin was widely regarded as a chivalrous foe, merciful to his prisoners and generally observant of the knightly customs of battle, but on this occasion he did something rather shameful. After the Crusaders had surrendered, Saladin was approached by some Sufis, members of an Islamic sect that hadn't participated in the battle and asked if they might kill some of the prisoners so that they too could gain merit. Saladin granted their request and let them slaughter the helpless prisoners.