quality:corruption
Reign prior to the conflict with the pope

Otto of Brunswick had been crowned Holy Roman Emperor by Pope Innocent III in October 1209. In southern Italy, Otto became the champion of those noblemen and barons who feared Frederick's increasingly strong measures to check their power, such as the dismissal of the pro-noble Walter of Palearia. The new emperor invaded Italy, where he reached Calabria without meeting much resistance.

In response, Innocent sided against Otto, and in September 1211 at the Diet of Nuremberg Frederick was elected in absentia as German King by a rebellious faction backed by the pope. Innocent also excommunicated Otto, who was forced to return to Germany. Frederick sailed to Gaeta with a small following. He agreed with the pope on a future separation between the Sicilian and Imperial titles, and named his wife Constance as regent. Passing through Lombardy and Engadin, he reached Konstanz in September 1212, preceding Otto by a few hours.

Frederick was crowned king on 9 December 1212 in Mainz. Frederick's authority in Germany remained tenuous, and he was recognized only in southern Germany. In the region of northern Germany, the center of Guelph power, Otto continued to hold the reins of royal and imperial power despite his excommunication. Otto's decisive military defeat at the Bouvines forced him to withdraw to the Guelph hereditary lands where, virtually without supporters, he died in 1218.

The German princes, supported by Innocent III, again elected Frederick king of Germany in 1215, and he was crowned king in Aachen in mid-July 1215 by one of the three German archbishops. Frederick then astonished the crowd by taking the cross and calling upon the nobles present to do the same. It was not until another five years had passed, and only after further negotiations between Frederick, Innocent III, and Honorius III – who succeeded to the papacy after Innocent's death in 1216 – that Frederick was crowned Holy Roman Emperor in Rome by Honorius III, on 22 November 1220. At the same time, Frederick's oldest son Henry took the title of King of the Romans.

Unlike most Holy Roman emperors, Frederick spent few years in Germany. In 1218, he helped King Philip II of France and Odo III, Duke of Burgundy, to bring an end to the War of Succession in Champagne (France) by invading Lorraine, capturing and burning Nancy, capturing Theobald I, Duke of Lorraine and forcing him to withdraw his support from Erard of Brienne-Ramerupt. After his coronation in 1220, Frederick remained either in the Kingdom of Sicily or on Crusade until 1236, when he made his last journey to Germany. He returned to Italy in 1237 and stayed there for the remaining thirteen years of his life, represented in Germany by his son Conrad.

In the Kingdom of Sicily, he built on the reform of the laws begun at the Assizes of Ariano in 1140 by his grandfather Roger II. His initiative in this direction was visible as early as the Assizes of Capua (1220, issued soon after his coronation in Rome) but came to fruition in his promulgation of the Constitutions of Melfi (1231, also known as Liber Augustalis), a collection of laws for his realm that was remarkable for its time and was a source of inspiration for a long time after. It made the Kingdom of Sicily an absolutist monarchy; it also set a precedent for the primacy of written law. With relatively small modifications, the Liber Augustalis remained the basis of Sicilian law until 1819.

In 1223–1224, Frederick tried Bishop Aldoin of Cefalù for maladministration. The trial was nullified by the pope on procedural grounds.