In 1500, Louis XII made an agreement with Ferdinand II on dividing the Kingdom of Naples, as Frederick IV was removed from the Neapolitan throne. This was known as the Treaty of Grenada. This decision was heavily criticized by influential figures such as Niccolo Machiavelli, whose opinion was embraced by many of Italy’s citizens as well. When Charles V came into power in 1519, he gained more of a reputation in Italy, as he joined Spain together with the Holy Roman Empire. The French then invited the Spanish to migrate into Italy.