Bringing together of the Lithuanian lands began in the late 12th century. Mindaugas, the first ruler of the Grand Duchy, was crowned as Catholic King of Lithuania in 1253. The pagan state was targeted in the religious crusade by the Teutonic Knights and the Livonian Order. When Gediminas began to rule, he allowed people to have different religions. This grew under his son Algirdas. In 1386 Jogaila changed the religion to Catholicism. He also made a dynastic union between the Grand Duchy of Lithuania and the Kingdom of Poland.