
238 B.R. 475 (1999)
In re Theodore W. CONNOLLY, Debtor.
Robert J. Williams, Inc., Appellant,
v.
Official Unsecured Creditors' Committee, Appellee.
BAP No. NC-99-1054-RRyMe. Bankruptcy No. 95-11748-AJ.
United States Bankruptcy Appellate Panel of the Ninth Circuit.
Argued and Submitted July 23, 1999.
Decided August 10, 1999.
*476 Julie H. Rome-Banks, Binder & Malter, San Jose, CA, for Robert J. Williams, Inc.
Robert A. Franklin, Murray & Murray, Palo Alto, CA, for Official Unsecured Creditors Committee.
Before RUSSELL, RYAN, and MEYERS, Bankruptcy Judges.

OPINION
RUSSELL, Bankruptcy Judge.
An oversecured creditor appeals the bankruptcy court's order denying creditor an award of attorneys' fees and costs incurred in connection with its defense of a preference action. We AFFIRM.

I. FACTS
In January 1993, Connolly Development, Inc. ("CDI") and appellee Theodore W. Connolly ("Connolly") entered into an agreement with appellant Robert J. Williams, Inc. ("Williams") under which Williams was to provide legal services to CDI and Connolly. The legal services agreement contained the usual employment provisions as well as a provision for attorneys' fees and costs incurred by the prevailing party in connection with the enforcement of the legal services agreement:
The prevailing party in any legal proceeding brought to enforce or determine rights arising out of this agreement shall be entitled to reasonable attorney's fees and reasonable disbursements, to be awarded by the court as costs. The prevailing party, as Judgment Creditor, shall also be entitled to reasonable attorney's fees, costs and disbursements incurred in enforcement or satisfaction of the Judgment rendered in said legal proceeding.
General Terms of Agreement for Legal Services, ¶ 10.
In March 1995, CDI and Connolly assigned to Williams a $350,000.00 promissory note, payable to CDI by a third party, "as security for payment of the obligations of [CDI] and [Connolly] for past and future legal services rendered and costs advanced." Security Agreement, ¶ 1. Similar to the legal services agreement, the security agreement also provided for attorneys' fees to the prevailing party incurred in connection with the enforcement or interpretation of the security agreement:
In any action or proceeding brought to enforce or interpret the terms of this agreement, the prevailing party shall be entitled to reasonable costs and expenses thereof, including attorneys' fees, as may be determined by the court.
Security Agreement, ¶ 7.
In July 1995, both CDI and Connolly filed separate voluntary chapter 11[1] petitions. CDI scheduled a secured debt due and owing to Williams in the amount of $333,423.00. Connolly scheduled an unsecured *477 claim due and owing to Williams in the amount of $373,951.58.
In July 1997, the Official Unsecured Creditors' Committee[2] ("Committee") filed an adversary proceeding to recover the debtors' alleged preferential transfer to Williams of the security interest in the $350,000.00 promissory note. The court ultimately ruled in Williams' favor and awarded it costs of the suit as the prevailing party.
Williams subsequently filed a motion for attorneys' fees and costs pursuant to § 506(b) incurred in connection with its successful defense of the Committee's preference action. Williams asserted that it incurred attorneys' fees of $34,949.50 and costs of $474.10, plus fees and costs of $2,310.00 in making the motion. Williams contended that it was an oversecured creditor because as of the petition date, the aggregate balance due under the promissory note was $447,708.00 and the balance due to Williams was $385,830.95. Williams argued that it was entitled to reasonable attorneys' fees as provided for in both the legal services agreement and the security agreement because it successfully defended the Committee's challenge to the enforcement of the security agreement.
The Committee asserted that its preference action against Williams involved the avoidance of the debtors' grant of a security interest in the promissory note, not the legal services agreement of January 1993. The Committee argued that § 506(b) did not give a party any greater right to attorneys' fees than provided for in the underlying agreement. The Committee argued that the preference action did not seek to enforce or interpret the terms of the security agreement, but rather sought a finding that the effect of the security agreement and Williams' perfection thereof was a preference under the Code. The Committee contended that the preference action was beyond the scope of the attorneys' fees provision in the security agreement.
The court conducted a hearing on Williams' motion for attorneys' fees and costs and concluded that Williams was not entitled to attorneys' fees simply because it prevailed in the adversary proceeding. The court found:
Because this was not an attack on the validity of the security interest but only an attempt to obtain ownership of the security interest for the estate that I see it as strictly an action under the Bankruptcy Code and not appropriate for the award of attorney's fees.
Transcript of Hearing on July 24, 1998, p. 3, lines 19-23.
The court subsequently issued a "Memorandum re Attorneys' Fees" and determined:
The issue of whether Williams's [sic] attorneys' fees may be added to its secured claim is not properly raised in this adversary proceeding. If the fees are to be litigated in bankruptcy court at all, they are properly raised in an action to determine the validity and extent of Williams's [sic] lien. There are two compelling practical reasons for this. First of all, the dispute is entirely moot if the estate abandons any interest in the creditor's collateral. Second, there may be junior creditors who would be prejudiced by the increase in the amount of the senior lien and are not parties to the adversary proceeding.
Williams is clearly not entitled to attorneys' fees just because it prevailed in this adversary proceeding. If it is entitled to any compensation at all for such fees, it is in the nature of an increase in the amount of its secured claim. That issue was never raised in this adversary proceeding and is not before the court.
Memorandum re Attorneys' Fee, p. 2, lines 12-22.
*478 Williams filed a "Motion for (1) Determination and Allowance of Secured claim, (2) Determination of Oversecured Status of Claim, and (3) Allowance of Interest and Reasonable Attorneys' Fees and Costs" ("Motion"). Williams sought attorneys' fees of $50,619.50 and costs of $2,800.74, of which $34,949.50 in attorneys' fees and $1,746.87 in costs were related to the defense of the Committee's preference action. As stated in its prior motion for attorneys' fees and costs, Williams reiterated the position that both the security agreement and the legal services agreement provided for the recovery of reasonable attorneys' fees and costs.
The Committee maintained the position that its preference action against Williams did not purport to enforce or interpret the security agreement. Thus, the scope of the attorneys' fees provision in the security agreement did not provide for the recovery of attorneys' fees incurred in the defense of a preference action.
In October 1998, a hearing on the Motion took place, at which the court concluded that the Committee's preference action against Williams was not an attack on the validity of the security interest. The court determined that the preference action "was not to prohibit [Williams] from enforcing [the security agreement]. The action was to take [the security interest in the promissory note] away from [Williams] and give it to the estate." Transcript of Hearing on October 16, 1998, p. 5, lines 12-14.
The court issued a "Memorandum of Decision" and reasoned:
A preference action is not an action on the contract. Ordinarily, attorneys' fees are not recoverable for a successful defense of a preference action, notwithstanding an attorneys' fee provision in the underlying contract. [Citation omitted].
Memorandum of Decision, p. 1, lines 20-22. The court also noted that the legal services agreement was signed more than two years prior to the granting of the security interest and found that "[t]here [was] no connection between the attorney-client agreement and the security interest in the note; it was only the latter which was at issue in the preference action." Memorandum of Decision, p. 2, lines 19-20. The court issued its order denying Williams' Motion. Williams appeals.

II. ISSUE
Whether the bankruptcy court erred in determining that appellant was not entitled to attorneys' fees pursuant to § 506(b) incurred in connection with its defense of a preference action.

III. STANDARD OF REVIEW
A bankruptcy court's award of attorneys' fees pursuant to § 506 will not be disturbed unless the bankruptcy court abused its discretion or erroneously applied the law. In re Kord Enterprises II, 139 F.3d 684, 686 (9th Cir.1998).

IV. DISCUSSION
Analysis of the issue of the award of attorneys' fees to an oversecured creditor must begin with the statute itself. Section 506(b) provides:
To the extent that an allowed secured claim is secured by property the value of which, after any recovery under subsection (c) of this section, is greater than the amount of such claim, there shall be allowed to the holder of such claim, interest on such claim, and any reasonable fees, costs, or charges provided for under the agreement under which such claim arose.
11 U.S.C. § 506(b).
The parties agree that Williams is an oversecured creditor. The parties' dispute centers on whether both the legal services agreement and the security agreement provide for attorneys' fees incurred in connection with the defense of a preference action.
*479 Williams argues that while § 506(b) establishes the right of the oversecured creditor to reasonable attorneys' fees, we must still look to state law to interpret the contractual provisions which give rise to the claim for attorneys' fees. We disagree.
Section 506(b) explicitly grants attorneys' fees to oversecured creditors if the underlying agreement so provides and does not refer to state law. Kord, 139 F.3d at 689. Section 506(b) completely preempts state law. As the bankruptcy court aptly found, the Committee's preference action only concerned the security agreement, not the legal services agreement. Thus, the security agreement is the underlying contract to be referred to in deciding whether Williams is entitled to attorneys' fees pursuant to § 506(b).
Under the security agreement, attorneys' fees are awarded to the prevailing party only in connection with the enforcement or interpretation of the security agreement. The Committee challenged Williams' ownership of the security interest in the promissory note, not the enforcement or the interpretation of the security agreement itself.
We disagree with Williams' contention that the attorneys' fees provision in both agreements were broadly worded and contained no restrictions which would prohibit the bankruptcy court's award of attorneys' fees in any circumstance, including preference actions. Preference actions exist independently of underlying agreements because such actions arise out of the transfer of the debtor's interest in property, and such transfers can occur with or without an underlying contract. In re Midway Airlines, Inc., 175 B.R. 239, 246 (Bankr.N.D.Ill.1994).
We therefore conclude that the bankruptcy court neither abused its discretion nor erred in finding that only the security agreement, not the legal services agreement, was the underlying contract upon which its claim arose, and that Williams' request for attorneys' fees pursuant to § 506(b) went beyond the scope of the attorneys' fees provision in the security agreement.

V. CONCLUSION
The bankruptcy court correctly found that appellant creditor's underlying agreement did not provide for the recovery of attorneys' fees in the successful defense of a preference action pursuant to § 506(b). Accordingly, we AFFIRM.
NOTES
[1]  Unless otherwise indicated, all chapter, section and rule references are to the Bankruptcy Code, 11 U.S.C. §§ 101-1330 and the Federal Rules of Bankruptcy Procedure, Rules XXXX-XXXX.
[2]  In September 1996, both estates confirmed a joint plan of reorganization, pursuant to which the estates were substantively consolidated. The Committee was formed pursuant to the order confirming plan of reorganization and the joint plan of reorganization.
