The King of Jerusalem was the supreme ruler of the Crusader States, founded by Christian princes in 1099 when the First Crusade took the city; the title disappeared with the departure of the last crusader of Tartus in August 1291, less than two centuries later. The Kingdom of Jerusalem had its origins in the First Crusade, when Godfrey of Bouillon, after refusing a crown and the title of King "upon the plea that he would never wear a crown of gold where his Saviour had worn a crown of thorns", took the title Advocatus Sancti Sepulchri (Protector of the Holy Sepulcher) in 1099 and was inaugurated as ruler of Jerusalem in the Church of the Nativity in Bethlehem. The following year, his brother Baldwin I was the first to use the title king and the first to be crowned king in the Church of the Holy Sepulchre in Jerusalem itself.

More Info: en.wikipedia.org