—In an action, inter alia, to enforce a restrictive covenant, the plaintiffs appeal, as limited by their brief, from so much of an order of the Supreme Court, Suffolk County (Tanenbaum, J.), entered February 28, 1989, as granted the defendants’ motion for summary judgment dismissing the first cause of action alleged in the complaint, and sua sponte, dismissed the remainder of the complaint on the ground of res judicata and the defendants cross-appeal, as limited by their brief, from so much of the same order, as inter alia, sua sponte, dismissed their counterclaims on the same ground.
Ordered that on the court’s own motion, the notices of appeal and cross appeal are treated as aplications for leave to appeal, the applications are referred to Justice Rubin, and leave to appeal and cross appeal is granted by Justice Rubin (CPLR 5701 [b] [1]); and it is further, *690Ordered that the order is affirmed insofar as appealed and cross-appealed from, without costs or disbursements.
The trial court properly sustained the parties’ affirmative defenses of res judicata in concluding that the plaintiffs’ action, as well as the defendants’ counterclaims, were barred under the doctrine of res judicata since the facts and issues raised thereby had been litigated in a prior action between the parties (see, Módica v Zergebel, 140 AD2d 414). Having failed to prove their claims in that action, they are barred from raising these claims anew in a subsequent action (see, O’Brien v City of Syracuse, 54 NY2d 353; Schwartz v Public Adm’r of County of Bronx, 24 NY2d 65).
We have examined the parties’ remaining contentions and find them to be without merit. Thompson, J. P., Brown, Rubin and Eiber, JJ., concur.