He was given as a hostage in Egypt to Al-Kamil but later released. In 1225 Louis took over the guardianship for the young king Henry. Subsequently, however, Louis's relationship with both his ward and the emperor deteriorated. With the latter, there were differences in matters of church policy, during the conflict with Henry (Louis intrigued with the Pope against the Staufer) in 1229 he even fought with military means, but the Bavarian duke was defeated. Thus under pressure he moved in 1230 back to Kelheim Castle.