OPINION OF THE COURT
Casey, J.At issue on this appeal is whether petitioner has an attorney’s lien (see, Judiciary Law § 475) against the proceeds of an unpaid judgment of the Court of Claims in favor of petitioner’s client, and if so, whether that lien should be enforced.
On November 8, 1984, petitioner entered into a retainer agreement with Andrew J. Britt, individually and doing business as Word Processing Transcribers, and Word Processing Transcribers, Inc. The subject matter of the agreement was a claim against the State arising out of a contract for the provision of transcription, typing and delivery services to the Department of Social Services. Pursuant to the retainer agreement, petitioner was entitled to a fee of 40% of any recovery. Petitioner commenced an action against the State on behalf of his clients in the Court of Claims on April 25, 1985. Summary judgment was granted to the corporate client in the amount of $150,263.24 by order of the Court of Claims filed July 22, 1986. Judgment in that amount was filed by the Chief Clerk of the Court of Claims on August 4, 1986.
Also relevant to this proceeding is an action brought by the State in Supreme Court against petitioner’s clients, commenced prior to the clients’ Court of Claims action previously described. In the Supreme Court action, arising out of the same contract for transcription, typing and delivery services to the Department of Social Services, the State sought damages in the amount of $1,554,301.17 based upon allegations of overbilling for services not actually rendered. By order entered March 18, 1987, partial summary judgment on the issue of liability was granted to the State and this court subsequently affirmed, concluding that the issue of liability had been established as a result of a guilty plea and criminal conviction of the individual client, Britt, who was also the president of the corporate client (see, State of New York v Britt, 148 AD2d 911). The issue of damages has not been resolved.
The State contends that petitioner is not entitled to a lien against the proceeds of the Court of Claims judgment since the State’s Supreme Court action arising out of the same transaction will likely result in a judgment in favor of the *157State which will exceed the Court of Claims judgment. The State also points out that petitioner was well aware of the State’s action in Supreme Court when the Court of Claims action was commenced. Petitioner argues that this is a simple question of lien priority and that his lien has priority over all others, including any right of setoff the State may have as a result of a judgment in the Supreme Court action, since his lien attached upon commencement of the Court of Claims action (see, Judiciary Law § 475). We conclude that this is not a case of lien priority. Rather, it is our view that, upon all of the facts and circumstances, and considering, the equitable nature of the relief sought by petitioner, petitioner has not established the existence of a lien.
A lien exists for any sum which the clients agreed their attorney should have as compensation for his services (see, Smith v Cayuga Lake Cement Co., 107 App Div 524, 526). Pursuant to the terms of the retainer agreement herein, petitioner’s entitlement to a fee is contingent upon there being a recovery. In such circumstances, the amount of the judgment is not necessarily controlling (see, Greenberg v Bar Steel Constr. Corp., 22 NY2d 210, 212-213). The effect of offsetting claims upon an attorney’s fee under a retainer agreement similar to the one at bar was considered in Mackey v Passaic Stone Co. (36 NYS2d 232, affd 266 App Div 690, affd 292 NY 525). In the Mackey case, the attorney agreed to prosecute a breach of contract claim on behalf of his clients and he was successful in establishing the claim, but the resulting judgment was diminished by the amount of a counterclaim arising out of the same contract. The trial court rejected the attorney’s argument that his fee of a percentage of "any moneys recovered” should be based upon the judgment obtained upon the claim which he prosecuted rather than upon the net amount paid (supra, at 233-234). In its affirmance, the Second Department found that the attorney was aware of the potential counterclaim when he executed the retainer agreement and that the attorney’s "preparation of a retainer setting up 'moneys recovered’ as a basis for the computation of his fee indicates that he assumed the risk that the recovery in moneys would be diminished by the allowance of the * * * counterclaim” (Mackey v Passaic Stone Co., 266 App Div 690, affd 292 NY 525). The Court of Appeals affirmance was without opinion.
*158In the case at bar, it is clear that when petitioner executed the retainer agreement and based his fee upon "any recovery” in the prosecution of his clients’ breach of contract claim against the State, petitioner was well aware of his clients’ potential liability to the State for alleged overbilling under the contract. Petitioner’s individual client was indicted on charges arising out of the overbilling prior to the November 8, 1984 execution of the retainer agreement (see, People v Britt, 148 AD2d 911, supra), and it appears that the summons with notice in the State’s Supreme Court action was served before petitioner executed the retainer agreement. The State points out that petitioner filed a notice of appearance on behalf of his clients in the State’s action, which occurred prior to execution of the retainer agreement. Petitioner does not dispute his awareness of the State’s claim but contends only that it is irrelevant. We disagree. As in Mackey v Passaic Stone Co. (supra), petitioner’s use of "any recovery” as the basis for his fee indicates his assumption of the risk that the recovery would be diminished by the allowance of the State’s claim arising out of the same transaction.
We note that the State at least implicitly acquiesced in the separate and distinct treatment of the claims by failing to elect to prosecute their claim as a counterclaim in the Court of Claims action (see, Court of Claims Act § 9 [3]) and by failing to seek a stay of the entry of judgment upon the order granting summary judgment in the Court of Claims action (see, Siegel, Practice Commentaries, McKinney’s Cons Laws of NY, Book 7B, CPLR C3212:31, at 449). Nevertheless, in the event that the State establishes damages in the amount claimed in its Supreme Court action, the net effect of petitioner’s efforts on behalf of his clients in prosecuting their breach of contract claim will be a reduction in the amount that will have to be paid to the State as a result of the clients’ breach of the same contract. In these circumstances, and in view of petitioner’s knowledge of the possible net effect of his efforts when he executed the contingent fee retainer, the Court of Claims judgment does not constitute a recovery within the meaning of the retainer agreement (see, Mackey v Passaic Stone Co., supra). Only in the event that the State fails to establish damages in excess of the amount of the Court of Claims judgment will there be a recovery giving rise to a fee for petitioner. Since petitioner has failed to establish his entitlement to a fee at this time, it follows that he has no lien *159pursuant to Judiciary Law § 475, and his petition to determine and enforce a lien must be dismissed.
Mahoney, P. J., Kane, Mercure and Harvey, JJ., concur. Order reversed, on the law, without costs, and petition dismissed.