
40 Cal.App.4th 1 (1995)
46 Cal. Rptr.2d 683
SALTARELLI & STEPONOVICH, Plaintiff and Appellant,
v.
PETER J. DOUGLAS, Defendant and Respondent.
Docket No. G014782.
Court of Appeals of California, Fourth District, Division Three.
November 14, 1995.
*3 COUNSEL
Saltarelli & Steponovich, Steponovich & Associates, Michael J. Steponovich, Jr., and Stephen A. Steponovich for Plaintiff and Appellant.
No appearance for Defendant and Respondent.
OPINION
RYLAARSDAM, J.
Plaintiff Saltarelli & Steponovich, a law firm, appeals from an order dismissing its action against Peter J. Douglas, a former client. The primary question presented is whether plaintiff's contractual lien on defendant's prospective recovery in the lawsuit for which the firm had been retained to represent defendant survived defendant's discharge in bankruptcy. We hold it does.

FACTS
Defendant retained plaintiff to represent him in a suit seeking damages for fraud, conspiracy to commit fraud and breach of contract entitled Douglas v. Weiner (Super. Ct. Orange County, 1988, No. 559656) (Weiner action). The parties signed an hourly retainer agreement which provided plaintiff "shall *4 have a Lien for ... fees and costs against any settlement, judgment, or compromise obtained in this matter" if it withdrew from the case. While the Weiner action was pending, plaintiff withdrew as defendant's attorney of record, claiming the latter had failed to pay fees and costs. Plaintiff then commenced this action, alleging defendant owed over $31,000 on account of these fees and costs.
Shortly thereafter, defendant filed a petition for bankruptcy. He listed plaintiff as an unsecured creditor, acknowledging a $31,924 debt. Plaintiff did not appear in the bankruptcy proceeding, but while the case was pending, it notified the parties in the Weiner action of the lien and filed a notice of lien in that case. The bankruptcy court discharged the debt.
Defendant next moved to dismiss this action, claiming it was barred by the discharge in bankruptcy. Plaintiff opposed the motion, conceding defendant's personal liability for the debt was discharged, but claiming the right to enforce the contractual lien. Plaintiff also submitted a proposed first amended complaint, asserting two counts; one seeking to establish the existence of an attorney's lien and a second for a declaration of rights on the lien's validity.
The trial court granted defendant's motion to dismiss without prejudice and set a further hearing on the motion, "the purpose being ... to give ... plaintiff ... an opportunity to seek exemption from the bankruptcy court discharge involving this particular claim...." The court told plaintiff, "If you think you can go over there an get an exemption, then I'll take up the issue of your amended complaint ...; but if you can't get that,... then I think ... this case is coming to a close."
Plaintiff sought a determination from the bankruptcy court on whether its lien survived defendant's bankruptcy; that court declined to rule on the matter, believing it would constitute an advisory opinion. The trial court then dismissed this action with prejudice, concluding defendant's personal liability for the unpaid fees had been discharged in bankruptcy and plaintiff had failed to perfect its lien before the bankruptcy proceeding.

DISCUSSION

1. The Validity of the Order Granting the Motion to Dismiss

(1) Although not mentioned in the brief, a question arises concerning the procedure used to dismiss the action. Defendant sought dismissal based on his bankruptcy discharge, relying on a declaration from his attorney and several exhibits. No statutory basis for dismissing the suit was cited.
*5 The procedure of moving to dismiss an action based on extrinsic evidence is disapproved in California and the motion is permitted only where it complies with the requirements for a motion for summary judgment. (Vesely v. Sager (1971) 5 Cal.3d 153, 167-169 [95 Cal. Rptr. 623, 486 P.2d 151], holding on another point abrogated by statute; see Cory v. Shierloh (1981) 29 Cal.3d 430, 435 [174 Cal. Rptr. 500, 629 P.2d 8]; Pianka v. State of California (1956) 46 Cal.2d 208, 211-212 [293 P.2d 458]; see also Levy v. Superior Court (1995) 10 Cal.4th 578, 584-585 [41 Cal. Rptr.2d 878, 896 P.2d 171].) Here, the motion utterly fails to comply with any of the procedural requirements for a summary judgment motion.
However, the motion may be treated as a nonstatutory motion for judgment on the pleadings. Such a motion may be granted when the complaint fails to state facts sufficient to constitute a cause of action. In considering this motion, the court may consider matters properly subject to judicial notice. (Barker v. Hull (1987) 191 Cal. App.3d 221, 224 [236 Cal. Rptr. 285].) Defendant's motion was based on the proposition his bankruptcy discharge eliminated both his personal liability and the lien. He argued plaintiff could not state a cause of action for relief. The trial court took judicial notice of the exhibits presented by the parties. The declarations, which were not a proper subject for judicial notice, were superfluous to the decision.
Accordingly, we treat the matter as an appeal from a dismissal entered after the granting of a nonstatutory motion for judgment on the pleadings.

2. The Enforceability of Plaintiff's Lien

(2a) Liens, not avoided or disallowed by the bankruptcy court, survive the discharge. (11 U.S.C. §§ 506(d), 522(c)(2); In re Dickinson (Bankr.S.D.Cal. 1982) 24 Bankr. 547, 550.) Thus, the discharge of an obligation to pay an attorney for prepetition legal services does not prevent the attorney from enforcing a lien securing payment for those services unless the lien has been disallowed or avoided during bankruptcy. (Matter of Pacific Far East Line, Inc. (9th Cir.1981) 654 F.2d 664, 668-670 [applying California law]; In re Anderson (Bankr.S.D. Ohio 1988) 95 Bankr. 506, 508; In re Reinhardt (Bankr.D.N.D. 1987) 81 Bankr. 565, 568-569; In re Marriage of Berkland (Colo.Ct.App. 1988) 762 P.2d 779, 782-783.)
Defendant listed plaintiff's debt as an unsecured claim in his bankruptcy petition and neither defendant nor the trustee took steps to avoid or disallow *6 the lien. (See In re Dickinson, supra, 24 Bankr. at pp. 549-550; In re Marriage of Berkland, supra, 762 P.2d at p. 782.) Thus, at least as between the parties to this action, if a valid lien existed before defendant filed bankruptcy, plaintiff can enforce it against any recovery by defendant in the Weiner action, even though defendant's personal obligation to plaintiff was discharged. (Compare In re Anderson, supra, 95 Bankr. at p. 508; In re Marriage of Berkland, supra, 762 P.2d at pp. 782-783 with In re Pierce (8th Cir.1987) 809 F.2d 1356, 1359-1361; In re Burnham (Bankr.N.D.Ga. 1981) 12 Bankr. 286, 290-291.).)
(3) State law governs the nature, extent and validity of a lien in bankruptcy proceedings. (Matter of Pacific Far East Line, Inc., supra, 654 F.2d at p. 668; In re Anderson, supra, 95 Bankr. at p. 508; In re Reinhardt, supra, 81 Bankr. at p. 566; In re Marriage of Berkland, supra, 762 P.2d at p. 782.) California recognizes the parties to an attorney retainer agreement can create a lien in favor of the attorney upon the proceeds of the client's prospective recovery in a lawsuit. (Civ. Code, §§ 2881, subd. 1, 2883, subd. (a); Cetenko v. United California Bank (1982) 30 Cal.3d 528, 531 [179 Cal. Rptr. 902, 638 P.2d 1299, 34 A.L.R.4th 657]; Hansen v. Jacobsen (1986) 186 Cal. App.3d 350, 355 [230 Cal. Rptr. 580].)
(2b) The agreement for an attorney's lien is decisive as to its existence. (Haupt v. Charlie's Kosher Market (1941) 17 Cal.2d 843, 845 [112 P.2d 627]; Bandy v. Mt. Diablo Unified Sch. Dist. (1976) 56 Cal. App.3d 230, 235 [126 Cal. Rptr. 890].) The parties' contract not only uses the term "Lien," but indicates plaintiff may look to the judgment or settlement as security for its fees and expenses. Consequently, the retainer agreement, if otherwise valid, created a lien. (Gelfand, Greer, Popko & Miller v. Shivener (1973) 30 Cal. App.3d 364, 371 [105 Cal. Rptr. 445]; Matter of Pacific Far East Line, Inc., supra, 654 F.2d at p. 669.)
(4) An attorney's lien arises upon execution of the retainer agreement. (Bluxome Street Associates v. Fireman's Fund Ins. Co. (1988) 206 Cal. App.3d 1149, 1158 [254 Cal. Rptr. 198]; Cappa v. F & K Rock & Sand, Inc. (1988) 203 Cal. App.3d 172, 174-175 [249 Cal. Rptr. 718].) While a discharged attorney must file an independent action to establish the amount of the lien and to enforce it (Hansen v. Jacobsen, supra, 186 Cal. App.3d at p. 356; Bandy v. Mt. Diablo Unified Sch. Dist., supra, 56 Cal. App.3d at p. 234), a judgment on the lien is not a condition precedent to its existence or viability.
In Cetenko v. United California Bank, supra, 30 Cal.3d 528, the Supreme Court held an attorney's lien contained in a retainer agreement had priority *7 over a third party's judgment lien because it was created earlier in time. (Id. at p. 534; see Civ. Code, § 2897.) In so ruling, the court rejected a claim the attorney had a "secret lien" stating, "We know of no authority, case law or statute, which compels an attorney to give notice to a client's creditors of a contractual lien on the judgment. In other jurisdictions where the matter has been considered, it has been held that the filing of a notice of lien by the attorney is not necessary to protect his security interest...." (30 Cal.3d at pp. 532-533.)
Other cases support the same conclusion. Bluxome Street Associates v. Fireman's Fund Ins. Co., supra, 206 Cal. App.3d 1149 affirmed an order granting priority to a law firm's lien for legal services over claimants holding perfected judgment and attachment liens. The court rejected claims the lien was unenforceable either because of an inability to perfect the lien under article 9 of the Uniform Commercial Code or because the firm never filed a notice of lien in the underlying action. (206 Cal. App.3d at pp. 1155-1156.) With respect to the latter contention, the court declared, "Providing notice of a lien is a statutory prerequisite to the creation or enforceability of certain types of liens.... [¶] As to a contractual lien under Civil Code section 2881 on a litigant's interest in a tort claim, however, we find no authority, statute, or case law which requires notice to create such lien." (Id. at pp. 1156-1157.)
Hansen v. Jacobsen, supra, 186 Cal. App.3d 350 reversed an order striking a discharged law firm's notice of lien on the client's recovery in the action, finding that, while the filing of such a notice was unnecessary to the lien's enforcement, it was nonetheless permissible. (Id. at pp. 357-358.) But in so ruling, the court noted, "In some jurisdictions, perfection of attorneys' liens by notice is governed by statute. [Citation.] Our Legislature, in establishing the procedures for filing liens in pending actions, has not established a method for attorneys with contractual liens to do so. [Citations.]" (Id. at p. 357.)
Thus, it was unnecessary for plaintiff to reduce defendant's indebtedness to a judgment, file a financing statement with the Secretary of State or even file a notice of lien in the Weiner action to perfect its lien. Plaintiff was entitled to proceed under its proposed amended complaint to determine the validity of the parties' retainer agreement and the amount of its lien on plaintiff's prospective recovery in the Weiner action. The trial court erred by finding plaintiff's lien unperfected and dismissing the action.
*8 The judgment is reversed and the matter remanded with directions to grant plaintiff the opportunity to amend its complaint and proceed with the action. Plaintiff shall recover its costs on appeal.
Sills, P.J., and Sonenshine, J., concurred.
