What is Affirmative Defense?

Legal Definition
An affirmative defense to a civil lawsuit or criminal charge is a fact or set of facts other than those alleged by the plaintiff or prosecutor which, if proven by the defendant, defeats or mitigates the legal consequences of the defendant's otherwise unlawful conduct. In civil lawsuits, affirmative defenses include the statute of limitations, the statute of frauds, waiver, and other affirmative defenses such as those listed in Rule 8 (c) of the Federal Rules of Civil Procedure. In criminal prosecutions, examples of affirmative defenses are self defense, insanity, and the statute of limitations.
-- Wikipedia
Legal Definition
A defense in which the defendant introduces evidence, which, if found to be credible, will negate criminal or civil liability, even if it is proven that the defendant committed the alleged acts. Self-defense, entrapment, insanity, and necessity are some examples of affirmative defenses. See, e.g. Beach v. Ocwen Fed. Bank, 523 U.S. 410 (1998).
Legal Definition
In code pleading. New matter constituting a defense; new matter which, assuming the complaint to be true, constitutes a defense to it. Carter v. Eighth Ward 'Bank, 33 Misc. Rep. 128, 67 N. Y. Supp. 300.
-- Black's Law Dictionary