(1) Upon the court’s initiative or motion of any party, the court shall award a reasonable attorney’s fee, including prejudgment interest, to be paid to the prevailing party in equal amounts by the losing party and the losing party’s attorney on any claim or defense at any time during a civil proceeding or action in which the court finds that the losing party or the losing party’s attorney knew or should have known that a claim or defense when initially presented to the court or at any time before trial:
(a) Was not supported by the material facts necessary to establish the claim or defense; or
(b) Would not be supported by the application of then-existing law to those material facts.
(2) At any time in any civil proceeding or action in which the moving party proves by a preponderance of the evidence that any action taken by the opposing party, including, but not limited to, the filing of any pleading or part thereof, the assertion of or response to any discovery demand, the assertion of any claim or defense, or the response to any request by any other party, was taken primarily for the purpose of unreasonable delay, the court shall award damages to the moving party for its reasonable expenses incurred in obtaining the order, which may include attorney’s fees, and other loss resulting from the improper delay.
(3) Notwithstanding subsections (1) and (2), monetary sanctions may not be awarded:
(a) Under paragraph (1)(b) if the court determines that the claim or defense was initially presented to the court as a good faith argument for the extension, modification, or reversal of existing law or the establishment of new law, as it applied to the material facts, with a reasonable expectation of success.
(b) Under paragraph (1)(a) or paragraph (1)(b) against the losing party’s attorney if he or she has acted in good faith, based on the representations of his or her client as to the existence of those material facts.
(c) Under paragraph (1)(b) against a represented party.
(d) On the court’s initiative under subsections (1) and (2) unless sanctions are awarded before a voluntary dismissal or settlement of the claims made by or against the party that is, or whose attorneys are, to be sanctioned.
(4) A motion by a party seeking sanctions under this section must be served but may not be filed with or presented to the court unless, within 21 days after service of the motion, the challenged paper, claim, defense, contention, allegation, or denial is not withdrawn or appropriately corrected.
(5) In administrative proceedings under chapter 120, an administrative law judge shall award a reasonable attorney’s fee and damages to be paid to the prevailing party in equal amounts by the losing party and a losing party’s attorney or qualified representative in the same manner and upon the same basis as provided in subsections (1)-(4). Such award shall be a final order subject to judicial review pursuant to s. 120.68. If the losing party is an agency as defined in s. 120.52(1), the award to the prevailing party shall be against and paid by the agency. A voluntary dismissal by a nonprevailing party does not divest the administrative law judge of jurisdiction to make the award described in this subsection.
(6) The provisions of this section are supplemental to other sanctions or remedies available under law or under court rules.
(7) If a contract contains a provision allowing attorney’s fees to a party when he or she is required to take any action to enforce the contract, the court may also allow reasonable attorney’s fees to the other party when that party prevails in any action, whether as plaintiff or defendant, with respect to the contract. This subsection applies to any contract entered into on or after October 1, 1988.