Empire. To promote a permanent military presence, territorial ownership was divided between the Church and the Order, with the Church taking Riga and two-thirds of all lands conquered and granting the Order a third. Until then, it had been customary for crusaders to serve for a year and then return home. Albert had ensured Riga's commercial future by obtaining papal bulls which decreed that all German merchants had to carry on their Baltic trade through Riga. In 1211, Riga minted its first coinage, and Albert laid the cornerstone for the Riga Dom. Riga was not yet secure as an alliance of tribes failed to take Riga. In 1212, Albert led a campaign to compel Polotsk to grant German merchants free river passage. Polotsk conceded Kukenois (Koknese) and Jersika to Albert, also ending the Livs' tribute to Polotsk. Riga's merchant citizenry chafed and sought greater autonomy from the Church. In 1221, they acquired the right to independently self-administer Riga and adopted a city constitution. That same year Albert was compelled to recognise Danish rule over lands they had conquered in Estonia and Livonia. Albert had sought the aid of King Valdemar of Denmark to protect Riga and Livonian lands against Liv insurrection when reinforcements could not reach Riga. The Danes landed in Livonia, built a fortress at Reval (Tallinn) and set about conquering Estonian and Livonian lands. The Germans attempted, but failed, to assassinate Valdemar. Albert was able to reach an accommodation with them a year later, however, and in 1222 Valdemar returned all Livonian lands and possessions to Albert's control. Albert's difficulties with Riga's citizenry continued; with papal intervention, a settlement was reached in 1225 whereby they no longer had to pay tax to the Bishop of Riga, and Riga's citizens acquired the right to elect their magistrates and town councillors. In 1226, Albert consecrated the Dom Cathedral, built St. James's Church, (now a cathedral) and founded a parochial school at the Church of St. George. In 1227, Albert conquered Oesel and the city of Riga concluded a treaty with the Principality of Smolensk giving Polotsk to Riga. Albert died in January 1229. He failed in his aspiration to be anointed archbishop but the German hegemony he established over the Livonia would last for seven centuries. Hanseatic League In 1282, Riga became a member of the Hanseatic League. The Hansa was instrumental in giving Riga economic and political stability, thus