Luther had already completed his treatise, Temporal Authority: To What Extent It Should Be Obeyed, in December 1522, but it was not published until March 1523. We should understand Luther’s ideas within the context of the fear of invasion of Electoral Saxony, particularly from Duke George of Saxony, who was Elector Frederick the Wise’s cousin. Additionally, Luther preached on the subject of government and the Gospel numerous times during 1522. Dedicating his treatise, On Temporal Authority, to Duke John of Saxony (Frederick’s brother and successor), Luther here defined his teaching on the two kingdoms. He stated that God had established two governments: one to keep order and rule the temporal realm, the other a spiritual government by which God makes sinners righteous.
While he advised obedience to temporal authorities, Luther mocked evil rulers in the first paragraph of Temporal Authority when he wrote, “For God Almighty has made our rulers mad; they actually think they can do—and order their subjects to do—whatever they please.”11 He explained that subjects are not obligated to obey their rulers in all matters, especially regarding the command to turn over Luther’s books to temporal authorities. Referring to Acts 5:29, Luther explained that Christians owed obedience to temporal authorities in earthly matters, but they should not willingly turn over books. However, if the authorities searched their homes and confiscated their property, they must suffer as Christians and not resist forcibly.
Later in Temporal Authority, Luther addressed resistance to unjust rulers. He explained that a prince may fight against a political equal or inferior, but not against the emperor. That prince should speak the truth against the superior but not resist him by force. Even when war is unavoidable, Luther asserted that a prince should fight to defend his subjects and not for personal gain. Additionally, he argued that Christian soldiers should serve in a war unless the soldier knew his prince had commanded him to fight an unjust war. In that case, Luther plainly instructed soldiers to disobey the prince, “… for it is no one’s duty to do wrong; we must obey God (who desires the right) rather than men.”
This is an excerpt from an article. If you would like to read the entire article go here: https://issues.cune.edu/enlightenment-liberty-vis-a-vis-christian-liberty/widerstand-luther-and-the-freedom-to-resist-unjust-authority/#_ftn10