In his opening statement before the committees charged with conducting an impeachment inquiry into President Trump, acting Ambassador William B. Taylor Jr. recalled the day of May 28, when he was asked by Secretary of State Mike Pompeo to lead the American Embassy in Ukraine.

Taylor seemed like a perfect candidate for the job. He had been a dedicated public servant for more than 50 years, spending three decades as a diplomat in Europe, the Middle East and Ukraine. He wanted to accept the position, but the web of political machinations recently on display in Ukraine and the United States made him hesitate. Taylor consulted with his wife, who told him — in no uncertain terms — that she strongly opposed the idea. Taylor then asked a senior Republican official whom he regarded as a mentor. His advice: “If your country asks you to do something, you do it.” So Taylor accepted the new position.

The argument that you report for duty when your country calls on you has a long-standing tradition in the diplomatic service — and not just that of the United States. A similar mind-set prompted several high-level German diplomats to remain in office after Adolf Hitler took power in 1933. Trump and Hitler may have little in common, yet the moral conflict facing their respective civil servants is much the same: Should diplomats resign or decline to serve if they have deep moral misgivings about their government’s policy, or should they remain in office to try to prevent worse from happening?

After Hitler was appointed German chancellor on Jan. 30, 1933, only one top German diplomat stepped down. In his letter of resignation, Friedrich von Prittwitz und Gaffron — at the time the German ambassador in Washington — explained his political attitude was deeply rooted in liberalism and republicanism and that, as a result and “for reasons of personal decency,” he could no longer serve the new German regime.

Prittwitz had hoped some of his colleagues would follow his lead — even though he knew most German diplomats more or less embraced the broad outlines of Nazi foreign policy. He nevertheless knew there were a precious few who neither shared nor believed in Hitler’s goals, and he hoped — in vain — they would join him in resigning.

They chose another path, however, following instead the advice of Secretary of State Bernhard von Bülow: “One does not abandon one’s country because it has a bad government.” Just how bad, Bülow would never find out. He died in 1936.

In the end, those who lived and served through the entire Nazi nightmare became accomplices to Hitler’s genocidal policies, willingly or not. That was true even for the small number of German diplomats who tried to reason with Hitler and his henchmen from behind the scenes.

One of those diplomats was Nazi Germany’s last ambassador to the United States, Hans Heinrich Dieckhoff, who remained in office despite early misgivings about the Third Reich. Before World War II, Dieckhoff sent a flurry of reports from Washington to Berlin desperately warning that war with America would have dire consequences for Germany. In a letter from early November 1938, for example, he presciently predicted that if Hitler were to choose a “road toward violence,” the U.S. government would do everything in its power to damp the “isolationist tendencies” of the American people and “throw the full weight of the United States behind the English.”

Dieckhoff’s counterpart in Moscow, Ambassador Friedrich-Werner Graf von der Schulenburg, similarly did all he could to prevent Nazi Germany from attacking the Soviet Union — to no avail. Schulenburg’s frustration was no doubt one reason he later joined a high-level conspiracy to assassinate Hitler; he paid for that with his life when the plot failed in July 1944.

After 1945, top-level foreign policymakers in Nazi Germany who had survived the war tried to justify their earlier cooperation with Hitler’s regime. Ernst von Weizsäcker, who succeeded Bülow as secretary of state in 1938, explained he had done so “to prevent even worse” from happening.

Such a remark rang hollow and cynical, especially once the world learned about the Holocaust and other atrocities committed by the Nazis. More to the point, Weizsäcker’s failure to have had a moderating influence on Nazi foreign policy demonstrated just how frustrating and difficult, if not impossible, it is for even a high-level diplomat to have a moderating influence on foreign policy — especially when one fundamentally disagrees with the course adopted by the head of state.

What, then, are diplomats to do when they realize that the foreign policy of their government is wrong and morally corrupt? Hans Heinrich Dieckhoff raised exactly this question in a speech he gave during the postwar period. “In that case, he can only — and even has to — try vehemently to steer his government on the right path,” he said. If that doesn’t work, he continued, the diplomat must resign.

Dieckhoff himself had failed to heed his own advice. As for why that was the case, he admitted such an action required courage — something “not everyone had, neither Germans nor other people.”

America under Trump is, of course, still far from Hitler’s dictatorship of the 1930s. The moral conflict — whether it is one’s duty to serve and represent your government even when one deeply disagrees with its political actions and the fundamental values it represents — is nevertheless comparable.

Taylor’s deposition should be seen by all Americans as a lesson in courage. Taylor did not resign from his post. But his plucky willingness to share his misgivings about the Trump administration’s Ukraine policies makes Taylor one of those rare career diplomats who make a real difference — not just behind the scenes, but by exposing out in the open questionable policies he considered counter to his personal ideals and to those of his country.

Other civil servants should take a close look at Taylor’s actions and remember why Aristotle rightly held courage as the first of all qualities. In our day, too, it remains the quality that guarantees all others.