Any examples of top government officials / soldiers refusing illegal orders?

We now have various threads going on about what will happen if Trump refuses to leave after losing the election. Any scenario in which he attempts to stay will likely involve Trump himself, or possibly William Barr, issuing illegal orders.

The question for this thread, then, is this. What are some historical examples of top officials, whether civilian or military, of someone refusing an order on the basis of the order being (in the opinion of the person receiving the order) illegal. Let’s try for examples from the United States, the closer to the present day the better, and the higher the levels involved the better. If no such examples exist, then let’s expand this to other democracies, further in the past, and lower levels of government. Let’s exclude any examples from non-democratic countries, where it’s likely the response will be to “disappear” said person.

Does the refusal of Attorney General Elliot Richardson and Deputy AG William Ruckelshaus to dismiss Watergate special prosecutor Archibald Cox (in the run-up to the infamous Saturday Night Massacre) count? Such a dismissal was ordered by Nixon, but doing so could have constituted obstruction of justice.

Yes, this is the sort of thing I’m looking for.

Knowing the military mindset, my guess is that if and when these things happen, they’re quietly brushed under the rug. An officer gives an illegal order and a subordinate refuses it. What happens then? The officer won’t put the subordinate on trial, because that will put the illegal order on the record; besides, having his order refused makes him look weak. So the officer will “change his mind”, retract the order, and everyone will act like the whole thing never happened. Any repercussions to the subordinate’s career will take place later.

Not an especially high-ranked officer, but a brave man and a heartening incident from a war crime in the midst of the Vietnam War:

A French general during WWI ordered his heavy guns to fire on his own infantry when they wouldn’t leave the trenches to attack the Germans. The artillery officer refused to obey the order unless it were put in writing, and the general backed down: A fictionalized version of this incident was in the Stanley Kubrick movie Paths of Glory.