From 1490 to his death in 1521 he was the leading statesman of Hungary and mainly responsible for foreign policy. It was solely through his efforts that Hungary did not accede to the league of Cambrai, was consistently friendly with Venice, and formed a family compact with the Habsburgs. He was also the only Magyar prelate who seriously aspired to the papal throne. In 1513, on the death of Julius II, he went to Rome for the express purpose of bringing about his own election as pope. He was received with more than princely pomp, and all but succeeded in his design, thanks to his extraordinary adroitness and the command of an almost unlimited bribing-fund. But Venice and the emperor played him false, and he failed.