249 F.3d 832 (9th Cir. 2001)
In re: LARRY'S APARTMENT, L.L.C., Debtor.MICHAEL A. GALAM, Appellant,v.MICHAEL   W. CARMEL, Chapter 11 Trustee for the Bankruptcy Estate of Larry's Apartment, L.L.C.;   ND DUCO CORPORATION, a Nevada corporation; LARRY JARNAGIN, husband; LINDA  JARNAGIN, wife, Appellees.
No. 00-15728
UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT
Argued and Submitted March 14, 2001,Filed April 26, 2001,

[Copyrighted Material Omitted]
Howard C. Meyers, Burch & Cracchiolo, P. A., Phoenix, Arizona; Rebecca R. Driggs, Casebolt, Germaine & Driggs, P.L.C., Phoenix, Arizona, for the appellant.
Michael W. Carmel, Phoenix, Arizona, for appellee Michael W. Carmel; David A. Weatherwax, Fennemore Craig, Phoenix, Arizona, for appellees Larry Jarnagin and Linda Jarnagin.
Appeal from the United States District Court for the District of Arizona. Roger G. Strand, District Judge, Presiding. D.C. Nos. CV-98-02044-PHX-RGS. CV-98-02045-PHX-RGS. CV-98-02046-PHX-RGS. CV-99-00082-PHX-RGS.
Before: Joseph T. Sneed, Ferdinand F. Fernandez, and Andrew J. Kleinfeld, Circuit Judges
FERNANDEZ, Circuit Judge:


1
Michael A. Galam appeals the district court's order which affirmed the bankruptcy court's order awarding attorneys' fees against him. The award was in favor of N.D. Duco Corporation, Larry Jarnigan and Linda Jarnigan (collectively NDDC) and Michael W. Carmel, trustee for the bankruptcy estate of Larry's Apartment, L.L.C. (the Debtor). Galam asserts that the award was improperly granted pursuant to fee statutes of the State of Arizona regarding sanctions  and contract claims. We agree and we reverse.

BACKGROUND

2
The Debtor operated a topless bar known as "The Jungle Cabaret" in Phoenix, Arizona. Michael T. Taraska, an attorney, was the major shareholder of the Debtor, and acted as its counsel. Throughout its operation, the Debtor leased a parking lot immediately to the west of The Jungle Cabaret, which it deemed to be necessary for the proper operation of the bar. The original lease was dated March 3, 1993, and was amended September 23, 1993. The lessor was the Abner E. England Trust. The September lease was for a term of five years with a five-year-renewal option. It provided that the lot was exclusively for the use of the bar. In December of 1993, the Debtor filed for bankruptcy. The September parking lease was included as an asset on the schedules filed in the bankruptcy action, and the Trust was listed as a creditor.


3
While the bankruptcy was still pending, a new lease of the parking lot was negotiated. Under that new lease, the monthly payments were reduced and the duration was changed from five years with a five-year-renewable option to a one-year lease with nine one-year-renewable options. The new lease required written notice  and a five-day-grace period before it could be terminated for default. It also permitted a subsequent purchaser to terminate the lease, provided that the lessee was given 60 days written notice within 30 days of the purchase.


4
Galam first became involved with the bar in March of 1994. He loaned Taraska $ 25,000 for use in operating the bar, and he also agreed to go to Phoenix to observe the bar in operation. He remained in Phoenix for a number of months. During that time, he managed the bar and the Debtor paid his living expenses, including hotel and apartment bills. Over time, Galam became a part owner of the Debtor. The bankruptcy court noted that his interest had increased to 60 percent at the time that this litigation was going forward.


5
In October of 1994, Taraska sent a letter to the Trust, offering to purchase the parking lot. The letter stated that Galam and Taraska, acting in their individual capacities, would purchase the lot for $ 90,000, but only Galam ultimately made the purchase. The title report revealed that the lot was leased by the Debtor, and indicated that the lease would be assigned to Galam. After the sale closed, Galam terminated the lease without further ado,  but he allowed the bar to continue to use the lot rent free until the middle of 1996.


6
However, in February of 1995 the Debtor filed a second voluntary petition in bankruptcy. This time the bankruptcy schedules did not list the parking lot as an asset. In June of 1996, NDDC filed an emergency motion to appoint a Chapter 11 trustee. After a five day hearing, the bankruptcy court granted the motion and Carmel was appointed. At the hearing, Taraska informed the court that the parking lot was essential to the bar's operation. He also stated that Galam, not the Debtor, owned the lot, and further told the court that if Taraska and Galam were removed from managing the bar, Galam would fence off and prohibit the bar from using that lot. Carmel informed Taraska and Galam that the Debtor had at least a possessory, if not an ownership, interest in the lot and also told them that interference with the Debtor's right to the lot would violate the automatic bankruptcy stay. Despite that warning, Galam proceeded to fence off the lot and to prohibit the bar from using it. This adversary action was then initiated, an injunction issued, and the matter ultimately proceeded to trial. Based on the evidence  presented at trial, the bankruptcy court found that due to Galam's breach of his fiduciary duty to the Debtor, a constructive trust would be imposed, and that the parking lot, whose ownership was then vested in Galam, was held for the benefit of the Debtor. The court also held that Galam was not entitled to any compensation for the lot because, even though he paid $ 90,000 to purchase it, he had improperly caused the Debtor to pay for his personal expenses, which expenses exceeded that amount.


7
Once the bankruptcy court had resolved the merits of the dispute and imposed the constructive trust on the parking lot, it turned to motions for attorneys' fees filed on behalf of Carmel and NDDC. It determined that a fee award was proper under Arizona law, which provides for a discretionary award of fees in contract cases. See Ariz. Rev. Stat.  12-341.01(A). It also determined that an award was proper as a sanction for Galam's delaying and harassing strategy in defending the claim against him. See Ariz. Rev. Stat.  12-349. It then awarded substantial fees and costs to the Trustee --$ 28,395 --and to NDDC --$ 605,756.98. Galam appealed to the district court which affirmed, whereupon  he appealed to us.

JURISDICTION AND STANDARD OF REVIEW

8
The district court had jurisdiction pursuant to 28 U.S.C.  158(a), and we have jurisdiction pursuant to 28 U.S.C.  158(d).


9
We review decisions of the bankruptcy court independently without deference to the district court's determinations. Robertson v. Peters (In re Weisman), 5 F.3d 417, 419 (9th Cir. 1993). The bankruptcy court's findings of fact are reviewed for clear error, while its conclusions of law are reviewed de novo. Id. "We will not disturb a bankruptcy court's award of attorneys' fees unless the bankruptcy court abused its discretion or erroneously applied the law." Kord Enters. II v. Cal. Commerce Bank (In re Kord Enters. II), 139 F.3d 684, 686 (9th Cir. 1998); see also Ford v. Baroff (In re Baroff), 105 F.3d 439, 441 (9th Cir. 1997).

DISCUSSION

10
Galam attacks the fee award on various grounds, two of which are dispositive for purposes of this appeal. He asserts that the action against him was not a contract action at all, and that it was improper to apply Arizona's sanction statute to this case in federal court.  As we will explain, we agree with him on both bases. As a result the fee award must be reversed.

A. Contract Fee Award

11
It is firmly established that "there is no general right to attorneys' fees for actions in bankruptcy. A party may, however, be entitled to attorneys' fees in the bankruptcy proceeding in accord with the applicable state law. " Collingwood Grain, Inc. v. Coast Trading Co., Inc. (In re Coast Trading Co., Inc.), 744 F.2d 686, 693 (9th Cir. 1984); see also Fobian v. W. Farm Credit Bank (In re Fobian), 951 F.2d 1149, 1153 (9th Cir. 1991). In this adversary action, the law of Arizona applies and it provides that "in any contested action arising out of a contract, express or implied, the court may award the successful party reasonable attorney's fees." Ariz. Rev. Stat.  12-341.01(A). The difficulty here is that the action in question was not on a contract at all, even though a contract lurked in the background.


12
On occasion, the courts in Arizona have spoken rather expansively regarding what it means to have an action arise out of a contract. The Arizona Supreme Court has explained that the mere fact that an insurance bad faith claim  sounded in tort did not preclude an award of fees because the facts could "show a breach of contract, the breach of which may also constitute a tort." Sparks v. Republic Nat'l Life Ins. Co., 132 Ariz. 529, 543, 647 P.2d 1127, 1141 (Sup. Ct. 1982) (en banc). The court went on to say that "the fact that the two legal theories are intertwined does not preclude recovery of attorney's fees under  12-341.01(A) as long as the cause of action in tort could not exist but for the breach of the contract." Id. Fees can also be awarded where the dispute is not over whether there was a breach of contract, but rather whether the contract was valid in the first place. See Marcus v. Fox, 150 Ariz. 333, 336, 723 P.2d 682, 685 (Sup. Ct. 1986) (en banc). On the other hand, where a contract is merely somewhere within the factual background, an award of fees under  12-341.01(A) is not proper. Thus, where an action was brought under a "Lemon Law" statute, it was held that it did not arise out of contract. Kennedy v. Linda Brock Auto. Plaza, Inc., 175 Ariz. 323, 325, 856 P.2d 1201, 1203 (Ct. App. 1993). It was true that the action could not  have existed at all but for the fact that there had been a contract to purchase an automobile in the first place. Still, said the court, the fee statute "does not apply if the contract is only a factual predicate to the action but not the essential basis of it." Id.


13
Other cases point out the same dichotomy. When the contract in question is central to the issues of the case, it will suffice as a basis for a fee award. See Carpenter v. Carpenter, 150 Ariz. 130, 136, 722 P.2d 298, 304, (Ct. App. 1985), vacated in part on other grounds, 150 Ariz. 62, 722 P.2d 230 (Sup. Ct. 1986) (en banc) (a breached property settlement agreement regarding life insurance was the heart of a claim for injunctive relief and imposition of a constructive trust); ASH, Inc. v. Mesa Unified Sch. Dist. No. 4, 138 Ariz. 190, 191, 673 P.2d 934, 935 (Ct. App. 1983) (an action to invalidate a contract did arise out of the contract). But the mere existence of a contract as a factor in an action does not allow a fee award where the contract is simply "peripherally involved in a cause of action." Lewin v. Miller Wagner & Co., Ltd., 151 Ariz. 29, 37, 725 P.2d 736, 744 (Ct. App. 1986).  Therefore, a malpractice action did not allow for a fee award, even though a contract to perform accounting services existed between the parties. Id. at 35, 725 P.2d at 742; see also Haldiman v. Gosnell Dev. Corp., 155 Ariz. 585, 590-91, 748 P.2d 1209, 1214-15 (Ct. App. 1987).


14
Of course, the nature of the action and the circumstances surrounding it must be considered when this issue is approached. See Wenk v. Horizon Moving & Storage Co., 131 Ariz. 131, 132, 639 P.2d 321, 322 (Sup. Ct. 1982). When that is done in this case, it becomes apparent that the action did not arise out of a contract at all. At most, the contract that Galam entered into with the seller of the land was peripheral to the action for a constructive trust. There was no claim of invalidity, and neither the Debtor nor NDDC was a party to the contract itself. See Morris v. Achen Constr. Co., Inc., 155 Ariz. 512, 514, 747 P.2d 1211, 1213 (Sup. Ct. 1987) (en banc). More than that, it did not matter just how Galam had come into possession of property that should have gone to the bankruptcy estate, and the fact that he had entered into a sales contract  with the then owner made no difference. That contract was merely peripheral, and had been fully performed by both parties to it. Certainly, the estate did not even want to set the contract aside; it wanted to obtain the land from Galam. But it was the full execution of the contract between Galam and the Trust that placed the property into his hands. In short, the contract may have been "a factual predicate to the action" in some sense, but it was not "the essential basis of it." Cashway Concrete & Materials v. Sanner Contracting Co., 158 Ariz. 81, 83, 761 P.2d 155, 157 (Ct. App. 1988). Therefore, the fee award could not be based upon that contract.

B. Sanction Fee Award

15
The other basis for the fee award was as a sanction provided for under Arizona law. That law does provide for the award of attorneys' fees, and other damages, as a sanction when an attorney or party does any of the following: "(1) Brings or defends a claim without substantial justification. (2) Brings or defends a claim solely or primarily for delay or harassment. (3) Unreasonably expands or delays the proceeding. (4) Engages in abuse of discovery." Ariz. Rev. Stat.  12-349. The bankruptcy court  and the district court relied upon that statute when they imposed fees upon Galam. While we do not question, or review, their determinations that Galam richly deserved to be sanctioned for his activities in this litigation, we do not agree that Arizona law should have been applied.


16
It is well established that "under the Erie doctrine [ Erie R. Co. v. Tompkins, 304 U.S. 64, 58 S. Ct. 817, 82 L. Ed. 1188 (1938)], federal courts sitting in diversity apply state substantive law and federal procedural law." Gasperini v. Ctr. for Humanities, Inc., 518 U.S. 415, 427, 116 S. Ct. 2211, 2219, 135 L. Ed. 2d 659 (1996). "Classification of a law as 'substantive' or 'procedural' for Erie purposes is sometimes a challenging endeavor." Id. When it comes to attorneys' fees, we have declared that "[a] federal court sitting in diversity applies state law in deciding whether to allow attorney's fees when those fees are connected to the substance of the case." Price v. Seydel, 961 F.2d 1470, 1475 (9th Cir. 1992); see also Kona Enters., Inc. v. Estate of Bishop, 229 F.3d 877, 883 (9th Cir. 2000). Thus, attorneys' fees may  be awarded by a district court when they are part of the state's substantive, rather than procedural, requirements. See, e.g., Klopfenstein v. Pargeter, 597 F.2d 150, 152 (9th Cir. 1979) (explaining that state law governs the question of attorneys' fees in diversity actions and holding that Alaska R. Civ. P. 82 authorized the district court's award of attorneys' fees to the prevailing party). However, when fees are based upon misconduct by an attorney or party in the litigation itself, rather than upon a matter of substantive law, the matter is procedural. Imposition of sanctions in that instance "depends not on which party wins the lawsuit, but on how the parties conduct themselves during the litigation." Chambers v. Nasco, Inc., 501 U.S. 32, 53, 111 S. Ct. 2123, 2137, 115 L. Ed. 2d 27 (1991). Thus, federal law applied in a case where "the District Court did not attempt to sanction petitioner for breach of contract, but rather imposed sanctions for the fraud he perpetrated on the court and the bad faith he displayed toward both his adversary and the court throughout the course of the litigation." Id. at 54, 111 S. Ct. at 2138 (footnote  omitted); see also People by Abrams v. Terry, 45 F.3d 17, 23 (2d Cir. 1995) ("It is quite anomalous to suggest that a federal court must look to the ... state legislature to vindicate an abuse of the federal judicial power."); Int'l Bus. Machs. Corp. v. Levin, 579 F.2d 271, 279 n.2 (3d Cir. 1978) (holding that federal, not state, court rules govern conduct in federal courts).


17
In other words, the federal courts must be in control of their own proceedings and of the parties before them, and it is almost apodictic that federal sanction law is the body of law to be considered in that regard. Anything less would leave federal courts subject both to the strictures of state statutes, and to state court judicial construction of those statutes. And the fact that an action is based on diversity, or is otherwise driven by substantive state law, should make no difference whatsoever. As we said long ago, "when an attorney appears before a federal court, he is acting as an officer of that court, and it is that court which must judge his conduct. " Cord v. Smith, 338 F.2d 516, 524 (9th Cir. 1964). Nor does the fact that this was a proceeding  in bankruptcy affect that conclusion. If anything, the need for uniform and expeditious handling of bankruptcy cases makes it even more important that federal, not state, sanction rules apply. See MSR Exploration, Ltd. v. Meridian Oil, Inc., 74 F.3d 910, 913-16 (9th Cir. 1996). Therefore, the bankruptcy court erred when it relied upon an Arizona statute for the purpose of imposing sanctions upon Galam; if sanctions were to be imposed at all, it had to be under the policies and procedures delineated under federal law.


18
In so stating, we are well aware of the fact that a number of our cases have allowed the imposition of litigation sanctions by reference to an Arizona sanction statute. See Blockbuster Videos, Inc. v. City of Tempe, 141 F.3d 1295, 1300 (9th Cir. 1998); Gilbert v. Ben-Asher, 900 F.2d 1407, 1411 (9th Cir. 1990); Hodge v. Kun (In re Kun), 868 F.2d 1069, 1072 (9th Cir. 1989); Lange v. Penn Mut. Life Ins. Co., 843 F.2d 1175, 1184 (9th Cir. 1988). For the most part, those cases have referred to a different statute --Ariz. Rev. Stat.  12-341.01(C). One, however, also referred to the statute  at hand --Ariz. Rev. Stat.  12-349. See Blockbuster Videos, 141 F.3d at 1300. At any rate, there is no real difference between the two Arizona statutes as far as the issue at hand is concerned. See State v. Richey, 160 Ariz. 564, 565-66, 774 P.2d 1354, 1355-56 (Sup. Ct. 1989) (en banc); Phoenix Newspapers, Inc. v. Dep't of Corrections, 188 Ariz. 237, 243-45, 934 P.2d 801, 807-08 (Ct. App. 1997).


19
What is significant, however, is the fact that we did not discuss the question of the propriety of using an Arizona sanction statute in an action in federal court; nor does it appear that the issue was then brought before us. In two of the cases, we simply declined to award fees where claims were made under both federal and state law. See Blockbuster Videos, 141 F.3d at 1300; Gilbert, 900 F.2d at 1411. In one, the district court had made a discretionary award of fees under Arizona Revised Statute  12-341.01. See Lange, 843 F.2d at 1183. The action was based upon an insurance contract, so the contract provision of that statute applied, which makes sense because it is a discretionary  provision. See Ariz. Rev. Stat.  12-341.01(A). However, the district court also referred to  12-341.01(C), which is a mandatory sanction provision. We said that did not matter because the reference "was merely one factor the court considered in its determination of fees." Lange, 843 F.2d at 1185. Thus, we had no occasion to consider whether a sanction statute, as such, would apply at all. In the final case, we determined that the Bankruptcy Appellate Panel had misinterpreted  12-341.01(C) as a provision that only allowed an award of fees to prevailing parties. In re Kun, 868 F.2d at 1072. We, therefore, reversed on that issue and remanded without considering whether the provision should apply at all.


20
In sum, those cases do not require us to hold that it is proper to use the Arizona sanction statutes in federal litigation. As the Supreme Court has said, "questions which merely lurk in the record, neither brought to the attention of the court nor ruled upon, are not to be considered as having so decided as to constitute precedents." Webster v. Fall, 266 U.S. 507, 511, 45 S. Ct. 148, 149, 69 L. Ed. 411 (1925); see also United States v. L.A. Tucker Truck Lines, Inc., 344 U.S. 33, 37-38, 73 S. Ct. 67, 69, 97 L. Ed. 54 (1952).  And, as we have said, the proper body of law and the one on which parties in federal court can and should adhere to and rely upon is federal, not state, law. That is not only a question of protecting the federal courts' power over their own proceedings, but also a question of fairness to those who are obliged to conform to federal standards when in federal court. For example, Federal Rule of Civil Procedure 11 contains prerequisites and protections for parties, who are accused of violating its strictures, and parties should be able to rely upon those in federal court proceedings. The same can be said about the scope of and protections offered by 28 U.S.C.  1927. Cf. Burlington N.R.R. Co. v. Woods, 480 U.S. 1, 7-9, 107 S. Ct. 967, 970-71, 94 L. Ed. 2d 1 (1987) (holding that Federal Rule of Appellate Procedure 38, not state statute, controlled fee award on appeal in diversity case). Moreover, it makes a great deal of sense to have a single group of sanctioning rules and decisions control behavior of parties in the federal courts, rather than a farrago of state and federal rules based on different policies or different views about the best way  to implement these policies.


21
Thus, we must also reverse the bankruptcy court's reliance on the Arizona sanction provisions when it award fees against Galam.

CONCLUSION

22
As our precis of the facts of this case shows, Galam's picaresque behavior both before and during this litigation is hardly admirable. His wrangling about issues in a situation where he was quite clearly in the wrong cannot be condoned.


23
Nevertheless, when the bankruptcy court awarded attorneys' fees against Galam, it erred because this was not a contract action, and it was not proper to rely upon an Arizona sanction statute to penalize Galam's actions in the federal courts. Therefore, we must reverse the award of fees.1


24
REVERSED.



Notes:


1
 We do not intend to preclude the bankruptcy court from considering an award of sanctions under federal law, and we express no opinion about what the proper outcome of that consideration should be.


