—In an action to recover damages for unjust enrichment, the plaintiff appeals from an order of the Supreme Court, Queens County (Berke, J.), dated March 4, 1999, which granted the defendant’s motion for summary judgment dismissing the complaint.
Ordered that the order is affirmed, with costs.
The plaintiff was not a good-faith purchaser for value of the subject property (see, Yen-Te Hsueh Chen v Geranium Dev. Corp., 243 AD2d 708), and therefore was barred by the doctrine of unclean hands from recovering damages for unjust enrichment (see, Kleeger v Kleeger, 261 AD2d 587). In addition, the existence of an enforceable written contract precluded recovery for unjust enrichment (see, Eagle Comtronics v Pico Prods., 256 AD2d 1202). Moreover, there was no showing that the defendant obtained a benefit that in equity and good con science he should not have obtained because it rightfully belonged to another (see, Bugarsky v Marcantonio, 254 AD2d 384). Bracken, J. P., Sullivan, Altman and Krausman, JJ., concur.