 Near the end of his life, and probably as a result of the aid of well-connected friends whom he never stopped badgering for intervention, Machiavelli began to return to the favor of the Medici family. In 1520, he was commissioned by Cardinal Giulio de'Medici to compose a History of Florence, an assignment completed in 1525 and presented to the Cardinal, who had since ascended to the papal throne as Clement VII, in Rome. Other small tasks were forthcoming from the Medici government, but before he could achieve a full rehabilitation, he died on 21 June 1527.