
345 S.C. 550 (2001)
548 S.E.2d 900
KEENEY'S METAL ROOFING, INC., Respondent,
v.
Brian A. PALMIERI, Cohn Development Group, Inc., First Palmetto Savings Bank, FSB, American Tool and Die Company, Inc., and American Manufacturers Mutual Insurance Company, Defendants, Of Whom Brian A. Palmieri, First Palmetto Savings Bank, FSB, and American Tool and Die Company, Inc., are, Appellants.
No. 3356.
Court of Appeals of South Carolina.
Heard June 4, 2001.
Decided June 18, 2001.
*551 R. Bryan Barnes and Jennifer L. Wile, both of Rogers, Townsend & Thomas, of Columbia, for appellants.
Cary M. Ayer, of Nicholson, David, Frawley, Anderson & Ayer, of Lexington, for respondent.
ANDERSON, Judge.
In this civil action, Brian A. Palmieri, American Tool and Die Company, Inc. ("ATD"), and First Palmetto Savings Bank, FSB ("First Palmetto") (collectively "Appellants"), moved the *552 Circuit Court for an award of attorney's fees and costs following their dismissal from the suit pursuant to Rule 12(b)(6), SCRCP. The court denied Appellants' motion, holding, in part: "[N]either the underlying policies of the mechanic's lien statutes nor the language of the statutes themselves contemplate or authorize awarding procedurally dismissed parties statutory attorney's fees and costs." We reverse and remand.

FACTS/PROCEDURAL BACKGROUND
Palmieri hired a general contractor, Cohn Development Group, Inc. ("Cohn") to construct a building on property he owned. Cohn then subcontracted with the respondent, Keeney's Metal Roofing, Inc., ("Keeney") to complete part of the work. Keeney later filed a mechanic's lien for the labor and materials used in constructing the building, claiming Cohn would not pay what was owed to it. Keeney named Palmieri and ATD as the owners, and Cohn as general contractor. After the lien was filed, Cohn posted a surety bond pursuant to S.C.Code Ann. § 29-5-110. As a result, the lien was transferred off the land and onto the bond. American Manufacturers Mutual Insurance Company ("American Manufacturers") issued the bond.
Despite the posting of the bond, Keeney sought to foreclose on the lien. Appellants, Cohn, and American Manufacturers were named as defendants in the action.
Pursuant to Rule 12(b)(6), the Circuit Court dismissed Appellants from Keeney's foreclosure action because the bond posted by Cohn discharged the lien on the property. Following their dismissal, Appellants filed a motion for attorney's fees and costs pursuant to § 29-5-20(A), asserting they had "defended and prevailed" against Keeney's mechanic's lien.
The court refused to grant attorney's fees to Appellants, finding:
 Cohn, having filed a bond discharging the property from the lien, assumed the owner's position and was the sole party entitled to attorney's fees;
 allowing attorney's fees to parties dismissed prior to a final resolution of the suit would frustrate the operation of *553 § 29-5-20(A), because it "has the potential to reduce any award of attorney's fees to any other parties";
 "until a final verdict is reached, there remains the possibility that no party would be entitled to an award of fees"; and
 "neither the underlying policies of the mechanic's lien statutes nor the language of the statutes themselves contemplate or authorize awarding procedurally dismissed parties statutory attorney's fees and costs."

ISSUE
Did the Circuit Court err as a matter of law by failing to award attorney's fees and costs to Appellants?

STANDARD OF REVIEW
An action to foreclose a mechanic's lien is a law case in South Carolina. Adams v. B & D, Inc., 297 S.C. 416, 377 S.E.2d 315 (1989).
The determination as to the amount of attorney's fees that should be awarded under the mechanic's lien statute is addressed to the sound discretion of the trial court. D.A. Davis Constr. Co. v. Palmetto Props., Inc., 281 S.C. 415, 315 S.E.2d 370 (1984). The court's decision regarding such a matter will not be disturbed absent an abuse of discretion. Id. An abuse of discretion occurs when, inter alia, the trial judge's ruling is based upon an error of law. Bayle v. South Carolina Dep't of Transp., 344 S.C. 115, 542 S.E.2d 736 (Ct.App.2001), cert. pending.

LAW/ANALYSIS
Appellants argue the Circuit Court erred in finding they were not entitled to attorney's fees and costs because they prevailed procedurally. We agree.
As a general rule, attorney's fees are not recoverable unless authorized by contract or statute. Jackson v. Speed, 326 S.C. 289, 486 S.E.2d 750 (1997); Blumberg v. Nealco, Inc., 310 S.C. 492, 427 S.E.2d 659 (1993). Section 29-5-20(A) requires the court to award reasonable attorney's fees and *554 costs to the party defending against the mechanic's lien if the defending party "prevails" in the action. See Utilities Constr. Co. v. Wilson, 321 S.C. 244, 248, 468 S.E.2d 1, 3 (Ct.App.1996) ("[T]he Legislature ... intended to afford a property owner [the] remedy [of recovering attorney's fees and costs] where a mechanic attempts to enforce a defective or wrongful mechanic's lien.") (citation omitted).
Our courts have defined "prevailing party." See Heath v. County of Aiken, 302 S.C. 178, 182-83, 394 S.E.2d 709, 711 (1990) (defining "prevailing party" as: "[T]he one who successfully prosecutes the action or successfully defends against it, prevailing on the main issue, even though not to the extent of the original contention ... the one in whose favor the decision or verdict is rendered and judgment entered.") (citation omitted); Seckinger v. Vessel Excalibur, 326 S.C. 382, 483 S.E.2d 775 (Ct.App.1997) (stating the defendant is entitled to an award of attorney's fees as the "prevailing party" if the trial court determines a mechanic's lien cannot be enforced against the defendant); Cedar Creek Props. v. Cantelou Assocs., Inc., 320 S.C. 483, 486, 465 S.E.2d 774, 776 (Ct.App.1995) (finding property owner was entitled to attorney's fees from contractor who filed a mechanic's lien against property owner, but ultimately cancelled it before the property owner's action to dissolve the lien was taken up by the Circuit Court: "[The property owner] is the `prevailing party' in this action. Although [the contractor] voluntarily cancelled the lien, it did so only after [the property owner] instituted an action to have the lien dissolved. Thus, although [the property owner] got the relief it sought, that is, avoidance of the lien, it still had to defend against the lien until the issue was resolved, and it incurred attorney fees and costs. ...") (footnote omitted); Maddux Supply Co. v. Safhi, Inc., 316 S.C. 404, 450 S.E.2d 101 (Ct.App.1994) (affirming the trial court's ruling that project owner who won on the merits of a mechanic's lien foreclosure action was the "prevailing party" and entitled to recover attorney's fees and costs on behalf of contractor who obtained a surety bond and provided for project owner's legal defense); Jasper County Bd. of Educ. v. Jasper County Grand Jury, 303 S.C. 49, 398 S.E.2d 498 (1990) (finding the definition of "prevailing party" clearly envisions a victory to some degree on the merits).
*555 In the instant case, the Circuit Court determined the mechanic's lien could not be enforced against Appellants because, under § 29-5-110, the surety bond took the place of the property upon which the lien existed. That section states, in part:
the owner or any other person having an interest in or lien upon the property involved may secure the discharge of such property from such lien by filing ... his written undertaking, in an amount equal to one and one-third times the amount claimed ... secured by ... cash or by a surety bond executed by a surety company licensed to do business in the State, and upon the filing of such undertaking ... the lien shall be discharged and the ... surety bond deposited shall take the place of the property upon which the lien existed. ...
Because there was no longer a lien against the property, Keeney could no longer recover from Appellants. See Shelley Constr. Co. v. Sea Garden Homes, Inc., 287 S.C. 24, 30, 336 S.E.2d 488, 492 (Ct.App.1985) (stating in its analysis of a mechanic's lien dispute: "If the property has been released from the lien by `bonding out,' the lien is no longer enforced against the property"). Keeney's claim against Appellants was therefore terminated.
Additionally, although Appellants were dismissed pursuant to a procedural rule, the dismissal was not on a mere technicality. Instead, Appellants prevailed because, as a matter of law, they could not be held liable for the damages Keeney sought under any circumstance. We are satisfied Appellants were the "prevailing parties" within the ordinary meaning of the statute; consequently, Appellants are entitled to recover attorney's fees and costs within the parameters delineated in § 29-5-20(A).

CONCLUSION
Keeney named Appellants as defendants in its foreclosure action. Keeney did so knowing a surety bond had been purchased to discharge Appellants' property from the lien. Appellants incurred attorney's fees and costs defending against Keeney's suit. By suing Appellants under § 29-5-20(A), Keeney triggered the remedies available to the named *556 defendants if they prevailed (i.e., recovery of attorney's fees and costs).
Pursuant to Rule 12(b)(6), the trial court determined Keeney was procedurally barred from obtaining relief from Appellants due to the posting of the surety bond. The Circuit Court's holding as to Appellants' dismissal motion was correct; however, its subsequent determination concerning their request for attorney's fees and costs was not. We rule a party may recover attorney's fees and costs under § 29-5-20(A) as a "prevailing party" even though the party obtained a dismissal via a procedural rule, provided the dismissal was not due to mere technicality. The decision of the Circuit Court denying Appellants' motion is reversed and remanded for determination of the issue of reasonable attorney's fees and costs.
REVERSED AND REMANDED.
HUFF and SHULER, JJ., concur.
