 After months of negotiation , John and the envoys from the Latin Empire signed a treaty in Perugia which was confirmed by Pope Gregory on 9 April 1229 . John was elected emperor of the Latin Empire for life as senior co @-@ ruler with Baldwin II , who would marry John 's daughter Marie . The treaty also prescribed that although Baldwin would rule the Latin lands in Asia Minor when he was 20 years old , he would become sole emperor only after John 's death . John also stipulated that his sons would inherit <unk> and Macedonia , but the two regions still belonged to Emperor of <unk> Theodore <unk> . 
