By the Grace of God (Latin Dei Gratia, abbreviated D.G.) is a formulaic phrase acknowledging fealty to God. It has its origins as a paraphrase from St. Paul in the Bible, 1 Corinthians 15:8–10, which states, "Last of all, as to one born abnormally, he appeared to me. For I am the least of the apostles, not fit to be called an apostle, because I persecuted the church of God. But by the grace of God I am what I am...".
It has been used especially in Christian monarchies as an introductory part of the full styles of a monarch historically considered to be ruling by divine right, not a title in its own right. For example in England and later the United Kingdom, the phrase was used over the course of centuries, most famously in the opening greeting of Magna Carta. It was formally added to the royal style in 1521 and continues to be used to this day. For example, on UK coinage, the abbreviation DG still appears. In other Commonwealth realms, variations of the style are used, specifying the realm in question and varying some of the other elements of the title.
Originally, it had a literal meaning: the divine will was invoked—notably by Christian monarchs—as legitimation (the only one above every sublunary power) for the absolutist authority the monarch wielded. This is also known as the divine right of kings, that is, the endorsement of God for the monarch's reign.
The Christian Roman emperors during the late Dominate came remarkably close to acting out the role of God's voice on earth. The eastern emperors, in particular, centralized all power in their hands, reducing the patriarch of Constantinople to their "(state) minister of the cult" and proclaiming their "universal" authority. Elsewhere during the medieval period, kings faced regular challenges to their authority from nobles, clergy, dynastic rivals and foreign powers. Even where they claimed to rule by God's grace, the political realities often reflected otherwise.
By custom, the phrase "by the Grace of God" is restricted to sovereign rulers; in the feudal logic, a vassal could not use it, because he held his fief not by the grace of God almighty, but by grant of a superior noble, (in)directly from the crown. Yet this did not stop kings to continue using it, even when some of them did homage to the pope (as viceregent of God) or another ruler (sometimes even mutually), on account of some (minor or "external") fief, or even for their actual principality, such as the Kingdom of Bavaria, a state of the Holy Roman Empire.
While the "incantation" of divine Grace became a prestigious style figure that few Christian monarchies could resist, it is not a literal carte-blanche from Heaven, but rather a consecration of the "sacred" mystique of the crown. Some of that survives even in modern constitutional monarchies and finds expression in most even mildly religious republics and dictatorships, where all power has been transferred to elected (party) politicians. In modern, especially recently (re-)founded monarchies, more realistic power reports (often crucially a voice in the succession and the purse strings) do in time find expression, sometimes even in abandoning "By the Grace of God", or rather, especially earlier, in the intercalation of compensatory phrases, such as "and the will of the people", or replacing the genitive "sovereign of X-place" by "sovereign of the X-inhabitants", quite meaningful where linked to the Enlightenment-notion of the "social contract", which means the nominal 'sovereign' is in fact potentially subject to national approval, without which a revolution against him can be legitimate.
The phrase was used in Luxembourg until 2000, when Henri, the current grand duke, decided to drop it. Like the use of the term "subject" for the citizens of a monarchy, "by the Grace of God" is a protocolary form that has survived the emancipation of the electorate from its once absolute rulers, who now rule only in name, but without direct political power. During the 20th century during the dictatorship of Francisco Franco in Spain, Spanish coins bore a legend identifying him as Francisco Franco, por la G. de Dios Caudillo de España ("by the G(race) of God, Leader of Spain").
Parallels exist in other civilizations, e.g. Mandate of Heaven of the Chinese empire, where for centuries the official decrees by the emperors of China invariably began with the phrase 「奉天承運皇帝，詔曰」 which is translated as "The Emperor, by the Grace of Heaven, decrees".
Today, even though most western monarchies are constitutional, with all political power having passed to the people (by referendum or, generally, elections), the traditional phrase "by the grace of God" is still included in the full titles and styles of a number of monarchs. In Europe, monarchs still using the style are those of Denmark, Liechtenstein, the Kingdom of the Netherlands, and the United Kingdom. The Lord of the Rasulid Order also continues to use the style.
In other Commonwealth realms, who share the same monarch with the United Kingdom, the style is used in Antigua and Barbuda, Australia, The Bahamas, Belize, Canada, Grenada, Jamaica, New Zealand, Solomon Islands, St. Kitts and Nevis, St Lucia, St. Vincent and the Grenadines, and Tuvalu. Papua New Guinea does not use the style.
The phrase is not used in the monarchies of Belgium, Luxembourg (Jean, abdicated 2000), Monaco, Norway (Haakon VII, died 1957), and Sweden (Gustav VI Adolf, died 1973). In Spain, article 56(2) of the 1978 constitution, states that the title of the King of Spain is simply "King of Spain" (Rey de España) but that he "can use the titles that correspond to the Crown". As a result, the King of Spain may use "by the grace of God", but this is not used on official documents.