Last resort
Meaning: something that you do because everything else has failed, if there is no other alternatives left
Example: Soldiers were given the authority to shoot, but only as a last resort.
Example: Soldiers were given the authority to shoot, but only as a last resort.