
    George J. KENNEY, Plaintiff-Appellant, v. UNITED STATES of America, Defendant-Appellee, and Ticor Title Co. of California, Defendant-counter-claimant. George J. Kenney, Plaintiff-Appellee, v. United States of America, Defendant-Appellant, and Ticor Title Co. of California, Defendant-counter-claimant. George J. Kenney, Plaintiff-Appellee, v. United States of America, Defendant-Appellant, and Ticor Title Co. of California; First Select Inc.; Eskanos & Adler, PC, Defendants. George J. Kenney, Plaintiff-Appellant, v. United States of America, Defendant-Appellee, and Ticor Title Co. of California; First Select Inc.; Eskanos & Adler, PC, Defendants.
    Nos. 04-16748, 04-17019, 05-15354, 05-15386.
    United States Court of Appeals, Ninth Circuit.
    Argued and Submitted June 12, 2006.
    Filed Aug. 17, 2006.
    
      Benjamin C. Sanchez, Tierney, Watson & Healy, San Francisco, CA, for the appellant.
    Kenneth L. Greene and Marion M. Erickson, U.S. Department of Justice, Washington, D.C., for the appellee/cross-appellant.
    Before HUG and O’SCANNLAIN, Circuit Judges, and ROGER T. BENITEZ, District Judge.
    
      
       The Honorable Roger T. Benitez, United States District Judge for the Southern District of California, sitting by designation.
    
   HUG, Circuit Judge.

This case concerns U.S. Government (“Government”) tax liens on the proceeds of the sale of a house owned by George Kenney (“Kenney”) and his former wife, Donna. They owned the house as joint tenants. The Government liens extend only to Donna’s interest in the proceeds. Over the years Kenney had made the entire payments on the notes secured by deeds of trust on the property, both his share and Donna’s share. He contends that pursuant to oral agreements with Donna those payments of her share were to be applied to diminish Donna’s interest in the house, and by the time the Government liens attached Donna had no remaining interest in the house or the proceeds of the sale of the house. Kenney and the Government also disagree on how Kenney should receive equitable subrogation for the loan payments he made; at issue is the amount of the proceeds to which the Government is entitled and whether Kenney should receive interest on his equitable subrogation. There is also an issue of entitlement to litigation costs and attorneys fees. We have jurisdiction under 28 U.S.C. § 1291.

I. Factual Background

In December 1978, Kenney and Donna purchased a house in Fremont, California. Kenney and Donna paid $25,000 down and obtained a loan for the remaining $52,950 of the house’s cost. Kenney and Donna were co-obligors on a promissory note secured by a deed of trust on the house, and they held title as joint tenants.

In June 1989, Kenney and Donna permanently separated. In August 1991, Kenney agreed to assist Donna in obtaining an additional $59,750 loan from a different lender. The loan proceeds were paid to Donna alone, but Kenney and Donna jointly executed a note and second deed of trust against the house to secure the promissory note. Pursuant to oral agreements between Kenney and Donna made between 1989 and 1991, Kenney agreed to assume responsibility for the two loans on the house. From 1989 until the house was sold in 2002, Kenney made all of the payments on the loans. In total, Kenney paid principal and interest of $166,826 on the two loans, according to the parties’ joint stipulation for summary judgment.

Between November 1995 and April 1997, the Government filed five tax liens against Donna relating to her business for tax years 1991-1995. In 1996, Kenney and Donna began divorce proceedings. On November 29, 1996, they entered into a property settlement agreement. The agreement was incorporated into the judgment of marriage dissolution, filed on March 6, 1997. Under the agreement, Donna was required to execute a quitclaim deed to the residence in favor of Kenney. She executed this deed on October 9, 1999.

Kenney subsequently decided to sell the house. To allow this in light of the Government’s liens against Donna’s share, the Government and Kenney entered into a substitution-of-proceeds agreement. Under this agreement, Kenney agreed that the liens would attach to the sale proceeds to the same extent as to the house itself.

On July 2, 2002, the house was sold for $395,000. The net proceeds were $307,244, after payment of the balances due on the notes secured by the deeds of trust and expenses of sale. The Government asserted its liens against one-half of those proceeds, or $153,622, which was held in escrow by Ticor Title Company of California.

II. Procedural History

On August 19, 2003, Kenney filed a complaint against the Government to quiet title in the sale proceeds under 28 U.S.C. § 2410. He named Ticor as a co-defendant, but Ticor was dismissed from the suit after the sale proceeds and interest earned on the proceeds were taken from escrow and deposited with the clerk of the court.

On June 30, 2004, Kenney and the Government filed cross motions for summary judgment. Kenney contended in his motion for summary judgment that, as a result of his payments on the notes secured by the deeds of trust and the oral agreements with Donna, Donna’s interest in the house and proceeds had diminished to zero. As an alternate theory, Kenney contended that he was entitled to equitable subrogation against Donna’s interest for the payments he had made on Donna’s share of the notes secured by the deeds of trust. Kenney also contended that he was entitled to interest on the payments he made on behalf of Donna.

In reply, the Government denied Kenney’s entitlement to recovery under his “diminishing interest” theory, but agreed that he was entitled to equitable subrogation, although this theory had neither been mentioned in the complaint nor had facts consistent with this theory been alleged in the complaint. The Government denied that he was entitled to interest on the payments he paid for Donna’s share. The Government also arrived at a different calculation of the manner in which the equitable subrogation was to be applied and sought summary judgment for a different amount.

In a published order on July 30, 2004, the district court granted summary judgment in part to the Government and denied summary judgment to Kenney. Kenney v. United States, 329 F.Supp.2d 1193 (N.D.Cal.2004). The order rejected Kenney’s diminishing interest theory, but calculated an equitable subrogation award for Kenney that did not include interest on his payments as Kenney requested. Id. at 1198. The court rejected the Government’s calculation of the equitable subrogation and adopted in substance Kenney’s calculation. Final judgment was entered August 11, 2004.

On August 24, 2004, Kenney filed a motion for an award of litigation costs under 26 U.S.C. § 7430, which the district court granted to the extent that the costs were attributable to the equitable subrogation theory. The district court made this order an amendment nunc pro tunc to the final judgment. The district court also ordered the parties to present specific evidence of litigation costs, and on February 22, 2005 the district court granted Kenney $5,814.38 in litigation costs ($5,664.38 in attorney fees and $150 in costs).

The Government and Kenney filed timely notices of appeal from both the August 2004 final judgment and February 2005 order.

III. Analysis

1. Kenney’s Diminishing Interest Theory

We review de novo a district court’s partial grant of summary judgment in favor of the United States. United States v. $100,348 in U.S. Currency, 354 F.3d 1110, 1116 (9th Cir.2004).

Kenney’s opening brief argues that as a result of the oral agreements to assume Donna’s loan obligations, Donna impliedly agreed to proportionately transfer to Kenney her equity interest in the house. Therefore, Kenney would have gained all of Donna’s interest before the tax liens attached. However, in his reply/answering brief, Kenney concedes that this argument has been foreclosed by In re Marriage of Benson, 36 Cal.4th 1096, 32 Cal.Rptr.3d 471, 116 P.3d 1152 (2005), which held that such agreements are required to be in writing. Kenney then raises the new argument that the precedent established by Benson suggests that remand is necessary to “address the question of what additional rights against the property, if any, Kenney may have that are superior to the tax liens.” But Benson established no new rights, and Kenney already had a full opportunity to present legal and equitable theories to the district court.

2. Calculating Kenney’s equitable subrogation award

The parties do not dispute that Kenney is entitled to equitable subrogation for some of the house sale proceeds. To whatever extent Kenney is subrogated to the rights of the lenders, he has priority over the Government in the disputed proceeds, since the lenders’ interests are senior to the later-filed Government liens. The method of calculating Kenney’s equitable subrogation award is a question of law. We review de novo the district court’s conclusions of law. Tritchler v. County of Lake, 358 F.3d 1150, 1154 (9th Cir.2004).

Under the district court’s method, the $307,244 net proceeds were divided into equal shares of $153,622 for Kenney and Donna, whereupon equitable subrogation was applied to credit Kenney $83,413 from Donna’s $153,622 share. The $83,413 represents half of the $166,826 in mortgage payments that Kenney made between 1989 and 2002 on the two notes. After deducting the $83,413 award from Donna’s share' of $153,622, there remained $70,209 in Donna’s share available to satisfy the Government liens.

On appeal, the Government argues that Kenney’s $83,413 should be taken from the total net proceeds of $307,244, leaving a' balance of $223,831 to divide between Kenney and Donna, of which $111,915:50 (Donna’s half) would be available to satisfy the Government liens. The Government’s approach would increase its-portion by $41,706.50. The Government argues that because equitable .subrogation only allows Kenney to “stand in the shoes” of the lenders, he should be paid from the net proceeds as a lender, before his and Donna’s shares are divided.

As the district court noted, the Government’s method would force Kenney to take his subrogation award from proceeds in which he has a half interest, effectively forcing him to pay for half of the amount to which he is entitled. See Kenney, 329 F.Supp.2d at 1198. The Government relies on Caito v. United California Bank, 20 Cal.3d 694, 144 Cal.Rptr. 751, 576 P.2d 466 (1978) in contending that only the $83,413 paid on Donna’s account should be deducted as equitable subrogation from the entire proceeds of the sale before the division between Donna and Kenney. The Caito case does not support the Government’s position. In that case the Caitos and the Caponis were cotenants of a farm and secured a loan from Bank of America (“B of A”) secured by a deed of trust on which the parties were equally liable. The Caponis executed another note to United California Bank (“UCB”) that was secured by a deed of- trust on the Caponis’ one-half interest in the farm. The Caitos operated the farm and made payments of $17,500 to B of A from the proceeds of the farm operation. Ultimately B of A foreclosed and at issue was the amount of proceeds from the sale of the farm in excess of B of A’s lien that UCB, as the Caponis’ lien holder, was to receive. The California Supreme Court held that in applying equitable subrogation the Caitos would be entitled to the amount they paid for the Caponis’ share of the obligation. The court stated, “UCB could not expect to benefit from an improved security position resulting from the Caponis’ debt paid by the Caitos. The- Caitos would then have paid a debt ‘for which another is primarily liable, and which in equity and good conscience should have been discharged by the latter.’” Caito, 144 Cal. Rptr. 751, 576 P.2d at 472 (citations omitted). The method of calculation proposed by the Government would allow the Government to benefit from an improved security position resulting from Donna’s debt paid by Kenney.

Several other California cases establish that Kenney should be credited from the total net proceeds for the $166,826 in principal and interest payments that he made. Southern Adjustment Bureau, Inc. v. Nelson, 230 Cal.App.2d 539, 41 Cal.Rptr. 148, 149 (1964), held that

[w]hen a cotenant makes advances from his own pocket to preserve the common estate, his investment in the property increases by the entire amount advanced. Upon sale of thé estate he is entitled to be reimbursed his entire advancement before the balance is equally divided.

(emphasis added). In Vides v. Vides, 215 Cal.App.2d 601, 30 Cal.Rptr. 447 (1963), a wife paid the mortgage installments on a house after her husband refused to pay. Upon the sale of the house,' the court held that “the wife’s use of her sepárate funds to discharge this obligation of the community gives her a right at least akin to subrogation.” Id. at 448. The court held that the wife should first be reimbursed from the net proceeds for the installment sums she had paid, with the remaining proceeds then divided equally between the spouses. Id.

It is apparent that there are two methods of calculation that arrive at the same result. Under one method of calculation, Kenney’s payments of $166,826 are deducted from the net proceeds of $307,244 for a balance of $140,418. Donna’s half of those proceeds would be $70,209, to which the Government is entitled. The other method is the one used by the district court in the instant case. The total net proceeds of $307,244 are divided, leaving Donna with her share of $153,622. From that is deducted one-half the payments made by Kenney ($83,413). This deduction leaves an identical final balance of $70,209 to which the Government is entitled. It is obvious that the full $166,826 Kenney paid should not be deducted from Donna’s share because one-half of that amount is applicable to his share. It is equally obvious that it is inequitable to deduct only half of the payments, $83,413, from the total net proceeds before dividing them, as the Government contends, because this would leave Kenney recovering only one-half of the payments he made for Donna. Equitable subrogation “is not a fixed and inflexible rule” and its development is “the natural consequence of a call for the application of justice and equity to particular situations.” In re Johnson’s Estate, 240 Cal.App.2d 742, 50 Cal.Rptr. 147, 149 (1966) (internal quotation omitted).

The district court reached the correct result in its calculation, holding that Kenney is entitled to $83,413 out of the $153,622 held in escrow; however, we must adjust its final conclusion, because the court incorrectly gave the Government all of the $2,735 escrow interest on the $153,622. Kenney’s award of $83,413 is 54% of the $153,622 in controversy, so he should properly receive 54% ($1,477) of the $2,735 escrow interest on the $153,622. His net award, therefore, should be $84,890 of the $156,357 in proceeds deposited with the clerk of the court. The Government should receive $1,258 in escrow interest in addition to its $70,209, leaving it with $71,467 of the $156,357. Any additional interest earned after the disputed proceeds were deposited with the clerk should be distributed 54% to Kenney and 46% to the Government.

3. Denial of interest on Kenney’s equitable subrogation award

The district court enjoys broad powers in equity,, and “its choice of equitable remedies is reviewed for an abuse of discretion.” Labor/Cmty. Strategy Ctr. v. Los Angeles County Metro. Transit Auth., 263 F.3d 1041, 1048 (9th Cir.2001). “The district court abuses its discretion when its equitable decision is based on an error of law or a clearly erroneous factual finding.” United States v. State of Washington, 157 F.3d 630, 642 (9th Cir.1998).

Kenney argues that the district' court erred in denying him interest on the payments he made for Donna. The district court stated that it denied interest because Kenney “has received a return on his investment through the appreciation in the value of the Property.” Kenney, 329 F.Supp.2d at 1198. Kenney cites Caito v. United California Bank, 20 Cal.3d 694, 144 Cal.Rptr. 751, 576 P.2d 466 (1978), to argue that the district court erred in denying interest by taking into account Kenney’s gain from the substantial appreciation in his interest in the house. This case is not applicable. Caito did not concern whether interest should be considered in an equitable subrogation award.

Under its broad powers in equity, the district court did not abuse its discretion in denying interest. The district court was free to consider that Kenney’s payments on behalf of Donna enabled him to protect his own half interest in the property — and that the property appreciated during the relevant time period. It appreciated in value from $246,000 in 1989 when Donna and Kenney separated to $395,000 when it was sold in 2002. We therefore affirm the district court’s denial of interest on Kenney’s equitable subrogation award.

A The award of litigation costs to Kenney

Section 7130(a) of Title 26 of the United States Code provides that a “prevailing party” in federal tax administrative or court proceedings may be awarded reasonable administrative and litigation costs. Kenney received an award of his litigation costs under section 7430(a), but did not request or receive an award for his administrative costs. The parties agree that Kenney was the prevailing party under section 7430(c)(4)(A), but dispute whether the Government established that its litigation position was “substantially justified” under section 7430(c)(4)(B). If the Government’s position was substantially justified, Kenney is not treated as the prevailing party. Id. “Substantially justified” means “justified to a degree that could satisfy a reasonable person,” or having “reasonable basis both in law and fact.” Pierce v. Underwood, 487 U.S. 552, 565, 108 S.Ct. 2541, 101 L.Ed.2d 490 (1988). To be substantially justified means more than “merely undeserving of sanctions for frivolousness.” Id. at 566, 108 S.Ct. 2541.

The district court’s determination of whether the position of the United States was substantially justified is reviewed for abuse of discretion. Pierce, 487 U.S. at 559, 108 S.Ct. 2541; Huffman v. C.I.R., 978 F.2d 1139, 1143 (9th Cir.1992). The district court abuses its discretion if it bases its decision on an erroneous legal conclusion or a clearly erroneous finding of fact. United States v. Marolf, 277 F.3d 1156, 1160 (9th Cir.2001).

We have held that the reasonableness of the Government’s position is analyzed separately for the administrative and the judicial proceedings. “[T]he position taken in the administrative proceeding does not automatically apply to the judicial proceeding ... [A] bifurcated analysis of ‘substantially justified’ should be made in each proceeding.” Huffman, 978 F.2d at 1146. The district court abused its discretion in analyzing the Government’s position in the litigation proceedings by including its position in the administrative proceedings. Kenney made no claim for costs and fees from the administrative proceeding. Huffman requires a bifurcated analysis of the Government’s position in the administrative proceedings separate from its position in the court proceedings.

In analyzing the legislative intent behind section 7430, Huffman noted that if the Government’s position in an administrative proceeding is not applicable, the Government’s position is that taken in the litigation. Id. at 1146. Because Kenney requested only litigation costs, we only examine the Government’s litigation position. The district court referenced a 2002 Kenney letter to IRS administrators in the administrative proceeding that asserted a right of subrogation, and the court wrongly faulted the Government for not responding to the assertion until the summary judgment stage of litigation. This mixes the analysis of administrative and judicial proceedings in a manner that contradicts Huffman.

Under the proper analysis, it is difficult to find the Government’s litigation position unreasonable. It is important that Kenney did not allege facts consistent with an equitable subrogation argument in his complaint filed in the district court. In fact, the key allegation that Kenney advanced in his complaint under the heading “Plaintiffs Acquisition of Interest” — that Donna’s interest in the home was zero when the Government’s November 1995 and June 1996 notices of tax liens were filed — is inconsistent with equitable subrogation but fully consistent with Kenney’s diminishing interest claim.

In its answer to Kenney’s complaint, the Government denied Kenney’s diminishing interest allegation. “Generally, the position of the United States in the judicial proceeding is established initially by the Government’s answer to the [complaint].” Huffman, 978 F.2d at 1148. The Government’s answer to Kenney’s complaint was entirely defensible. Indeed, the district court granted summary judgment to the Government on. the diminishing interest theory, & grant that we affirm in this opinion. For purposes of avoiding section 7430 costs, it cannot be the Government’s duty to address factual allegations not raised in a complaint. Had Kenney made factual allegations that would have put the Government on notice' of an equitable subrogation theory, and had the Government denied them, the Government’s litigation position as taken here might not have been substantially justified. See Hanson v. C.I.R., 975 F.2d 1150, 1156 (5th Cir.1993) (rejecting an approach wherein the Government could “pursue a substantively unreasonable theory in litigation, settle the case on the eve of summary judgment, and escape an award of litigation costs to the prevailing tax litigant”).

Only in his motion for summary judgment, ten months after he filed his complaint, did Kenney assert equitable subrogation before the district court. In response to the- motion, the Government conceded that equitable subrogation applied but disputed the amount that was available to Kenney. The Government’s response was reasonable under these circumstances. See Huffman, 978 F.2d at 1148 (“Case law holds that if the Government concedes the petitioner’s case in its answer, its conduct is reasonable.”).

We therefore reverse the district court’s order granting Kenney’s motion for litigation costs, and the district court’s award to Kenney of $5,814.38 in litigation costs. The district court abused its discretion in finding the Government’s litigation position not substantially justified.

IV. Conclusion

For the reasons expressed above, we AFFIRM the district court’s summary judgment grant in favor of the Government on Kenney’s diminishing interest theory. We AFFIRM the district court’s calculation of Kenney’s equitable subrogation, but adjust the amount to reflect the appropriate amount of interest on the funds held in escrow. We AFFIRM the district court’s denial of interest on Kenney’s equitable subrogation award. We REVERSE the district court’s award of litigation costs to Kenney.

AFFIRMED IN PART. REVERSED IN PART. 
      
      . Under 26 U.S.C. § 6323(i)(2), state law subrogation rights are recognized in determining tax lien priority rights. See Fidelity Nat’l Title Ins. Co. v. United States, 907 F.2d 868, 870 (9th Cir.1990). California law recognizes equitable subrogation. See, e.g., Caito v. United California Bank, 20 Cal.3d 694, 144 Cal.Rptr. 751, 576 P.2d 466, 471 (1978).
     
      
      . We use the subrogation calculation from the district court's final judgment, not the summary judgment order. In an earlier calculation for the summary judgment order, the district court used the figure of $167,269 as the amount of the payments on the notes rather than the $166,826 to which both parties now agree.
     
      
      . By undertaking to pay a debtor's obligation to a creditor, the subrogee is equitably subrogated to the position of the creditor and succeeds to the creditor's rights against the debtor; ”[t]he right of subrogation is purely derivative.” Reliance Nat’l Indem. Co. v. General Star Indem. Co., 72 Cal.App.4th 1063, 85 Cal.Rptr.2d 627, 635 (1999).
     
      
      .Ultimately the supreme court held that the $17,500 proceeds of the farm belonged to both the Caitos and the Caponis and was not an amount paid solely by the Caitos, and thus, the Caitos were not entitled to equitable subrogation. Caito, 144 .Cal.Rptr. 751, 576 P.2d at 473. The court also did not credit the Caitos under equitable subrogation an amount of $6,000 that had been loaned directly to the Caponis. Id.
      
     
      
      . See also Milian v. De Leon, 181 Cal.App.3d 1185, 226 Cal.Rptr. 831, 836 (1986) (A cotenant who pays trust deed payments against the property "is entitled to contribution from the cotenant, and on partition by sale is entitled to reimbursement for those expenditures before division of the proceeds among the property owners.”).
     