
220 Cal.App.3d 1494 (1990)
270 Cal. Rptr. 183
DOVER MOBILE ESTATES, Plaintiff and Appellant,
v.
FIBER FORM PRODUCTS, INC., Defendant and Respondent.
Docket No. H005714.
Court of Appeals of California, Sixth District.
May 31, 1990.
*1496 COUNSEL
Laurence B. Mitchell and Mitchell & Stock for Plaintiff and Appellant.
Roy Bolton for Defendant and Respondent.
OPINION
ELIA, J.
Appellant Dover Mobile Estates filed suit to recover rent from respondent Fiber Form Products, Inc. A court trial resulted in judgment in favor of Fiber Form. In its appeal, appellant argues that (1) a trustee's sale did not terminate Fiber Form's lease; (2) Fiber Form breached the covenant of good faith and fair dealing; and (3) the trial court erred in denying its motion to tax costs. We affirm.

FACTS AND PROCEDURAL BACKGROUND
In 1985, tenant Fiber Form entered into a five-year lease with landlord Old Town Properties, Inc. The lease provided that it was subordinate to any deeds of trust or mortgages placed on the property unless the mortgagee or beneficiary elected to have the lease be superior.[1]
*1497 Old Town subsequently encumbered the property with a second deed of trust to Saratoga Savings & Loan Association. Old Town defaulted. Saratoga Savings & Loan foreclosed and, at a December 3, 1986, trustee's sale, Income Property Investments, Inc. (hereafter Dover) purchased the property.[2] Dover knew of Fiber Form's lease before it purchased the property. In fact, the lease was of "supreme importance to its decision to purchase." A trustee's deed was recorded on December 5, 1986.
On December 4, 1986, Dover notified Fiber Form that it had purchased the property. It told Fiber Form to direct future rent payments to Dover's management company. The parties did not enter into a new lease but Fiber Form continued to pay rent per the lease.
On March 9, 1987, Fiber Form and Dover discussed reducing the monthly rental. The discussion was prompted by a downturn in Fiber Form's business. Fiber Form allegedly advised Dover that the foreclosure extinguished the lease and contended that it was operating under a month-to-month lease. Dover denies that such notice occurred but alleges that Fiber Form requested a one-year delay in the rent increase scheduled to take effect, pursuant to the lease, on May 1, 1987. Dover offered to delay the increase if Fiber Form extended the lease an additional year. This proposal was never accepted.
On June 1, 1987, Fiber Form gave Dover 30 days' written notice of its intent to vacate. Fiber Form subsequently vacated the premises and stopped paying rent.
Dover filed suit against Fiber Form for rent and conversion. The trial court determined that the trustee's sale terminated the lease and entered judgment for Fiber Form in the action to recover rent. Costs for attorney's fees in the amount of $7,255.95 were awarded to Fiber Form. This appeal ensued.

DISCUSSION

A. TERMINATION OF THE LEASE
(1a) Fiber Form argues that it became a month-to-month tenant after the trustee's sale because the sale extinguished the lease. Dover, on the other hand, contends that the lease was not terminated but was ratified because Fiber Form continued to pay rent after the trustee's sale. For *1498 reasons we shall state, we conclude that the trustee's sale extinguished the lease so that Fiber Form became a month-to-month tenant, thereby allowing Fiber Form to terminate on 30 days' notice.
(2) Title conveyed by a trusee's deed relates back to the date when the deed of trust was executed. (Bank of America v. Hirsch Merc. Co. (1944) 64 Cal. App.2d 175, 184 [148 P.2d 110].) The trustee's deed therefore passes the title held by the trustor at the time of execution. (Hohn v. Riverside County Flood Control etc. Dist. (1964) 228 Cal. App.2d 605, 612 [39 Cal. Rptr. 647].) Liens which attach after execution of the foreclosed trust deed are extinguished. The purchaser at the trustee sale therefore takes title free of those junior or subordinate liens. (Id. at p. 613; Carpenter v. Small-page (1934) 220 Cal. 129, 133 [29 P.2d 841]; see generally, Mortgage & Deed of Trust Practice 2d (Cont.Ed.Bar 1990) pp. 90-92.)
(3) A lease is generally deemed to be subordinate to a deed of trust if the lease was created after the deed of trust was recorded. (Bank of America v. Hirsch Merc. Co., supra, 64 Cal. App.2d at p. 184; 3 Miller & Starr, Cal. Real Estate (2d ed. 1989) § 8:82, p. 422.) On the other hand, "when the lease was executed and recorded prior to the recordation of the deed of trust, or if the beneficiary of the deed of trust had notice of an unrecorded lease at the time the trust deed was recorded, the lien of the trust deed is junior to the estate of the lessee...." (3 Miller & Starr, Cal. Real Estate, op. cit. supra, at § 8:82, p. 422, fn. omitted.)
A lease may also be deemed subordinate by virtue of a subordination agreement. (See, e.g., Tanner v. Title Insurance & Trust Co. (1942) 123 P.2d 497, 500, mod. 20 Cal.2d 814 [129 P.2d 383]; Bank of America v. Hirsch Merc. Co., supra, 64 Cal. App.2d at p. 182; Security-First Nat. Bank v. Marxen (1938) 28 Cal. App.2d 446, 453 [82 P.2d 727]; Civ. Code, § 2934.) "Subordination agreements are often used to adjust the priorities between commercial tenants and the mortgagee of the real estate,... Absent such an adjustment, priorities will be governed by the recording acts and related common law principles." (Nelson & Whitman, Real Estate Finance Law (2d ed. [L.Ed.] 1985) § 15.11, p. 1114.)
(4) A lease which is subordinate to the deed of trust is extinguished by the foreclosure sale. (Bank of America v. Hirsch Merc. Co., supra, 64 Cal. App.2d at p. 182; Dugand v. Magnus (1930) 107 Cal. App. 243, 247 [290 P. 309]; McDermott v. Burke (1860) 16 Cal. 580 590; 3 Miller & Starr, Cal. Real Estate, op. cit. supra, at § 8:82, pp. 422-424.) A foreclosure proceeding destroys a lease junior to the deed of trust, as well as the lessee's rights and obligations under the lease. (Nelson & Whitman, Real Estate Finance Law, *1499 op. cit. supra, at § 15.11, p. 1114.) As stated in section 15.1 of the Restatement Second of Property, Landlord and Tenant (1977) "[i]f the sale of the landlord's interest is forced by one having a paramount title to that of the tenant, such as a mortgagee whose interest existed at the time the lease was made, the tenant's interest will be defeated by the sale." (Id. at p. 90.)
(1b) In this case the lease itself provides that it is subordinate to the deed of trust. Section 21.1 provides, "[t]enant agrees that this Lease shall be subordinate to any mortgages or deeds of trust ... that may hereafter be placed upon the premises, ..." Although section 21.1 does give the mortgagee or beneficiary the option to elect "to have this Lease superior to its mortgage or deed of trust ...", that option was never exercised. Accordingly, it is clear that the lease is subordinate to the deed of trust and was therefore extinguished by the trustee's sale.
Dover argues that cases supporting the proposition that a subordinate lease is terminated by foreclosure were decided before 1945 and therefore do not consider "changes in real property transactions in modern times." (See, e.g., Bank of America v. Hirsch Merc. Co., supra, 64 Cal. App.2d 175; Carpenter v. Smallpage, supra, 220 Cal. 129; and McDermott v. Burke, supra, 16 Cal. 580.) We disagree.
The rule that a trustee's sale extinguishes a lease subordinate to the trust deed is not an antiquated principle. For example, in Gross v. Superior Court (1985) 171 Cal. App.3d 265 [217 Cal. Rptr. 284], the court quoted the following from the 1860 case McDermott v. Burke, supra, 16 Cal. at p. 589: "`[T]he legal rights of the lessee were extinguished by the proceedings in the foreclosure suit and sale following the decree thereon.... There is no privity of contract or of estate between the purchaser upon the decree of sale and the tenant. The purchaser may, therefore, treat the tenant as an occupant without right, and maintain ejectment for the premises.... The relation between the purchaser and tenant is that of owner and trespasser, until some agreement, express or implied, is made between them with reference to occupation.'" (Id. at p. 272.) Gross approved McDermott by acknowledging that "in the situation after foreclosure, no landlord-tenant relationship would exist." (Ibid.)
Similarly, in People v. Little (1983) 143 Cal. App.3d Supp. 14, 19 [192 Cal. Rptr. 619], the court acknowledged that foreclosure "wipes out" all liens, encumbrances, and leases subsequent in time to the trust deed so that there is no landlord-tenant relationship between a foreclosure purchaser and the occupant of the premises. A number of other authorities affirm the rule that a subordinate lease is terminated by foreclosure. (See, e.g., 3 Miller *1500 & Starr, Cal. Real Estate, op. cit. supra, at § 8:82, p. 422-424; Mortgage & Deed of Trust Practice 2d, op. cit. supra, at §§ 5.27, 5.41, pp. 266, 276; Rest.2d Property, Landlord and Tenant (1977) § 15.1, p. 90; Nelson & Whitman, Real Estate Finance Law, op. cit. supra, at § 15.11, p. 1114.)
We find no reason to question the continued validity of this rule. The fact that foreclosure terminates a subordinate lease comports with basic notions of priorities and notice. If the trust deed is recorded before the lease is created, then the tenant enters into the lease with notice that the lease will be subordinate. Alternatively, if the tenant and landlord expressly agree that the lease should be subordinate, as is the case here, then the tenant is aware of the possibility that its lease could be extinguished by foreclosure. Indeed, Fiber Form expressly agreed that the lease was subordinate to any trust deeds and therefore it risked having foreclosure terminate the lease. That Fiber Form, rather than Dover, ultimately desired that the lease be terminated upon foreclosure should be of no import.
Dover argues that foreclosure should not automatically terminate the lease but should give the purchaser the option of terminating it. However, if this were the rule, then the purchaser could evict the tenant if rent values increased or hold the tenant to the lease if rent values decreased. In other words, the purchaser could do whatever was most profitable. We decline to allow the purchaser this option. To the contrary, we think it more equitable to follow the rule that the trustee's sale automatically terminates the lease. Of course, even though the lease is extinguished, the tenant and purchaser are not precluded from entering into a new lease agreement.
Finally, we note that the tenant under a subordinate lease can obtain some protection by requiring the landlord to obtain from its lender a nondisturbance agreement in favor of the tenant. Such an agreement provides that the lender with a superior lien will not, "by foreclosure or otherwise, disturb the tenant's possession, as long as the tenant is not then in default under the lease." (Johnson & Moskovitz, Cal. Real Estate Law & Practice § 153.50, p. 153-94.) In addition, the tenant could bargain with its landlord for the right to cure the landlord's default. (Ibid.)
We next consider what Fiber Form's status was once the lease was terminated. Did Fiber Form become a tenant under a new lease agreement? There was evidence that in March 1987 Fiber Form notified Dover that it had been advised by counsel that the foreclosure extinguished the lease and therefore it was operating under a month-to-month tenancy. In addition, there was evidence that Dover believed the prior lease continued in effect after the foreclosure sale and, as a consequence, Dover did not attempt to *1501 obtain a new lease. We conclude that the foregoing constitutes substantial evidence in support of the trial court's conclusion that the parties did not enter into a new lease.
Having determined that no new lease agreement was reached, we conclude that Fiber Form was a month-to-month tenant. The prior lease was extinguished and a new lease was not entered into. Fiber Form paid rent monthly, with Dover's consent, but there was no agreement reached regarding the term of the hiring. Accordingly, Fiber Form must be deemed a month-to-month tenant, thereby entitled to terminate upon 30 days' notice. (Civ. Code, § 1944; Civ. Code, § 1946; Linnard v. Sonnenschein (1928) 94 Cal. App. 729 [272 P. 315]; Vavuris v. Pinelli (1957) 147 Cal. App.2d 390, 394 [305 P.2d 149].) Fiber Form gave such notice, vacated the premises and therefore was not obligated to pay any further rental.

B. BREACH OF COVENANT OF GOOD FAITH AND FAIR DEALING
Dover argues that Fiber Form's "attempt to avoid the lease constitutes a breach of the covenant of good faith and fair dealing." This contention must fail. We have already concluded that Fiber Form was a month-to-month tenant and acted properly in terminating on 30 days' notice. There was therefore no "attempt to avoid the lease" or any breach of the covenant of good faith and fair dealing.

C. MOTION TO TAX COSTS
(5) Dover's final argument is that the trial court erred in denying its motion to tax costs because there was insufficient proof of the attorney's fees portion of costs Fiber Form incurred. We disagree.
"The amount to be awarded as attorney's fees is left to the sound discretion of the trial court." (Vella v. Hudgins (1984) 151 Cal. App.3d 515, 522 [198 Cal. Rptr. 725].) The pleadings and depositions in the court files constitute evidence of the actual work performed. The court may consider such evidence in deciding whether the costs claimed in the memorandum of costs are reasonable. (Melnyk v. Robledo (1976) 64 Cal. App.3d 618, 624 [134 Cal. Rptr. 602].) In this case, the trial court had the opportunity to review the file, and hear the arguments of the parties on the motion. It determined that $7,255.95 was an appropriate figure. Such decision did not constitute an abuse of discretion.
*1502 The judgment is affirmed.
Premo, Acting P.J., and Cottle, J., concurred.
NOTES
[1]  Section 21.1 of the lease provided, "Subordination of Lease to Loans. Tenant agrees that this Lease shall be subordinate to any mortgages or deeds of trust in the nature of mortgages that may hereafter be placed upon the premises, to any and all advances made or to be made under them, to the interest on all obligations secured by them, and to all renewals, replacements, and extensions of them; provided, that if any mortgage or beneficiary elects to have this Lease superior to its mortgage or deed of trust and gives notice of its election to Tenant, then this Lease shall be superior to the lien of any such mortgage or deed of trust and all renewals, replacements and extensions thereof, whether this Lease is dated or recorded before or after the mortgage or deed of trust."
[2]  Dover Mobile Estates is the successor in interest to Income Property Investments, Inc.
