PER CURIAM:
Jocassee Partners Holdings, LLC (Jocassee) appeals the trial court's grant of summary judgment to Crenshaw's TV and Radio (Crenshaw) on its mechanic's lien foreclosure action and the award of costs and attorney's fees to Crenshaw. We reverse and remand to the trial court for an award of reasonable attorney's fees to Jocassee as the prevailing party.
Jocassee argued that the trial court erred in finding Crenshaw was the prevailing party and in awarding Crenshaw attorney's fees under section 29-5-20 of the South Carolina Code (2007) when Jocassee had previously tendered the full amount of the mechanic's lien, the final half of which Crenshaw had refused before it commenced foreclosure proceedings.
As a general rule, attorney's fees are not recoverable unless authorized by contract or statute. Blumberg v. Nealco, Inc., 310 S.C. 492, 493, 427 S.E.2d 659, 660 (1993). Under the mechanic's lien statute, attorney's fees are awarded by the court only if there is an action filed with the court. S.C. Code Ann. § 29-5-20 (A) (2007). The court may award to the prevailing party
Id. (emphasis added).
EFCO Corp. v. Renaissance on Charleston Harbor, LLC, 370 S.C. 612, 618, 635 S.E.2d 922, 925 (Ct. App. 2006) (quoting Heath v. County of Aiken, 302 S.C. 178, 182-83, 394 S.E.2d 709, 711 (1990)).
"Clearly, the intent of the legislature in allowing the prevailing party in an action brought under the mechanic's lien statute to recover attorney fees and costs stems from a desire to deter both wrongful filing of liens and unjustified refusal to pay debts subject to mechanic's liens." Cedar Creek Properties v. Cantelou Associates, Inc., 320 S.C. 483, 486, 465 S.E.2d 774, 775 (Ct. App. 1995).
In this case the lien was properly filed, but Crenshaw did not accept payment of the debt and refused to accept the second half of the payment for the mechanic's lien after previously accepting the first half. At that point in time, Crenshaw was not entitled to costs and fees. In defending the foreclosure action against the improper addition of costs and fees, Jocassee should have been the prevailing party and awarded attorney's fees. See § 29-5-20 (A) (stating the party defending against the lien prevails, the defending party must be awarded costs of the action and a reasonable attorney's fee as determined by the court).