The motion court correctly dismissed the complaint because “there is another action pending between the same parties for the same cause of action” in Supreme Court (CPLR 3211 [a] [4]). The court, sua sponte, dismissed defendant’s first counterclaim, not, as plaintiffs contend, because it confused the counterclaim with the complaint, but because the counterclaim is identical to a claim of defendant in the pending action. Indeed, the court expressly ordered that this action proceed as to the counterclaims to the extent they are not precluded by the pending action.
In light of the foregoing, the motion court should not have addressed whether the complaint states a cause of action (CPLR 3211 [a] [7]). Concur — Acosta, J.P., Saxe, Moskowitz and Feinman, JJ.