Qualified immunity

Definition
Qualified immunity protects public officials from being sued for damages unless they violated "clearly established" law of which a reasonable official in his position would have known. It aims to protect civil servants from the fear of litigation in performing discretionary functions entrusted to them by law. The qualified immunity test requires a two-part analysis: "(1) Was the law governing the official's conduct clearly established? (2) Under that law, could a reasonable officer have believed the conduct was lawful?"

Source

 * "Qualified Immunity Law & Legal Definition" (full-text).