OPINION OF THE COURT
Chief Judge Cooke.We hold that summary judgment may not be granted on *253a seller’s counterclaim for goods sold and delivered where there are unresolved factual issues, in the buyer’s action for damages, concerning whether the seller breached the underlying contract of sale.
In March, 1972, the parties entered into a written contract whereby plaintiff, Created Gemstones, was appointed distributor of defendant Union Carbide’s synthetic gems. Plaintiff agreed to buy and defendant undertook to sell a minimum of $400,000 worth of the gems each year for a period of 10 years. The agreement apparently was performed without incident until May 30, 1974, when defendant seller informed plaintiff that the latter’s line of credit would be limited to $200,000, and that any purchases in excess of that amount would be payable in cash. Notwithstanding this notice, defendant continued to extend credit to the buyer, as witnessed by plaintiffs $224,681.73 indebtedness to defendant on July 31, 1974.
When plaintiff placed two orders for gems in August, 1974, however, defendant allegedly refused to ship the goods on credit, advising that all orders should be prepaid. Defendant agrees that it insisted on cash payment for orders exceeding the unilaterally imposed $200,000 credit line. Shortly after the orders were rejected, plaintiff instituted this action for breach of contract and sought damages for resulting losses. In its answer, defendant interposed two counterclaims, one for the sum of $224,681.73 due for previous deliveries of gems, and the other for a small overcredit erroneously granted plaintiff.1
When defendant moved for summary judgment in respect to the complaint and the counterclaims, Special Term refused to dismiss the complaint, reasoning that whether the seller improperly imposed a credit limit and thus breached the contract is essentially a factual question.2 Nonetheless, the court granted summary judgment to defendant on the counterclaims on the ground that plaintiffs liability for the goods *254was clearly established. A divided Appellate Division upheld this portion of Special Term’s ruling.3
On this appeal,4 plaintiff argues that the same factual issues which precluded a grant of summary judgment on the complaint also dictate that summary judgment be denied as to the counterclaims. More specifically, plaintiff contends that defendant’s right to prevail on the counterclaims is dependent upon whether it breached the contract. It is correct.
It must be emphasized that the established rules relating to the discretionary granting of partial summary judgment are not here at issue (see, generally, 4 Weinstein-Korn-Miller, NY Civ Prac, par 3212.17; Siegel, New York Practice, § 285, pp 341-342). Plaintiff does not claim, for instance, that the Appellate Division abused its discretion by allowing immediate entry of judgment on the counterclaims, nor does it contend that the counterclaims and the main claim are so inextricably interwoven as to preclude partial summary judgment (see, e.g., Illinois McGraw Elec. Co. v John J. Walters, Inc., 7 NY2d 874, 876-877; Pease & Elliman v 926 Park Ave. Corp., 23 AD2d 361, affd 17 NY2d 890). Rather, plaintiff disputes its substantive liability on the counterclaims, arguing that liability cannot be established, as a matter of law, until it is determined whether defendant breached the contract of sale. Succinctly, the question is not whether summary judgment may be ordered on a counterclaim where defendant has shown a legal right to recover, but whether defendant has in law established its right to prevail. To resolve the issue, the provisions of the Uniform Commercial Code must be examined.
Principal reliance is placed upon section 2-717 of the Uniform Commercial Code, which allows a buyer to "deduct all or any part of the damages resulting from any breach of the contract from any part of the price still due under the same contract.” This statutory provision may be traced back to section 69 (subd 1, par [a]) of the Uniform Sales Act, which afforded a vendee a right of recoupment for any breach of warranty by the seller (Personal Property Law, § 150, subd 1, par [a], repealed by Uniform Commercial Code, § 10-102 [eff Sept., 1964]; see, also, Comment, The Uniform Commercial Code: Changes in the New York Law of Damages, 31 Fordham *255L Rev 749, 761-762). As construed by this court, the Sales Act section operated to extinguish a purchaser’s liability for goods sold and delivered, pro tanto, where he incurred damages by virtue of a breach of warranty (see, also, Ohl & Co. v Standard Steel Sections, 179 App Div 637, 641). Thus, in Peuser v Marsh (218 NY 505), it was held that a breach of warranty may be pleaded as a defense not only where the vendor sues for the unpaid purchase price, but also when replevin of the delivered goods is sought (id., at pp 508-509). In so holding, the court observed that the recoupment defense is "in effect a plea that the breach of warranty has operated to extinguish any further liability on account of the purchase price” (id., at p 508).
No reason can be discerned for holding, in the circumstances of this case, that section 2-717 of the Uniform Commercial Code functions in a different manner than the former Sales Act provision. Indeed, the intent underlying enactment of section 2-717 was not to alter the prior rule, but to expand it "so as to cover any breach of contract” (McKinney’s Cons Laws of NY, Book 62 Uniform Commercial Code, § 2-717, New York Annotations). It follows, therefore, that a buyer may defeat or diminish a seller’s substantive action for goods sold and delivered by interposing a valid counterclaim for breach of the underlying sales agreement. This conclusion, it may be noted in passing, is in harmony with the decisions of those courts which have had occasion to address the issue (see, e.g., Teeman v Jurek, — Minn —, —, 251 NW2d 698, 701-702 [Minn]; American Elec. Power Co. v Westinghouse Elec. Corp., 418 F Supp 435, 460).
Application of this principle to the present case dictates that summary judgment as to the counterclaims be denied. Both Special Term and the Appellate Division found that factual issues exist with respect to whether defendant breached the contract of sale. If, after trial, it is determined that defendant did in fact breach,5 then plaintiff’s liability on *256the counterclaims would, be extinguished to the extent that it was damaged by the breach. By the same token, should defendant be found not to have breached, it would be entitled to judgment on the counterclaims. Whatever the ultimate result, proper disposition of the counterclaims must await resolution of this factual question. It was therefore error to grant summary judgment.
Inasmuch as appellant failed to comply with an order of this court dated November 2, 1978, which granted a motion to strike certain portions of the record on appeal, costs are not awarded. Accordingly, the order of the Appellate Division, insofar as appealed from, should be reversed, without cysts, and defendant’s motion for summary judgment on its counterclaims denied.
Judges Jasen, Gabrielli, Jones and Wachtler concur with Chief Judge Cooke; Judge Fuchsberg taking no part.
Order, insofar as appealed from, reversed, etc.
. The damages sought in the complaint far exceeded the amounts demanded in the counterclaims.
. In reaching this conclusion, Special Term relied upon section 2-609 of the Uniform Commercial Code, and the following language in the contract: "if Distributor’s credit shall, in Union Carbide’s opinion, become impaired, if Union Carbide shall deem itself insecure, or if Distributor shall default in payment hereunder when due, Union Carbide may by written notice to Distributor declare payments for all shipments of products immediately due”. The propriety of this aspect of the ruling is not now before us.
. The Appellate Division modified by dismissing one of the causes of action in plaintiffs complaint, not relevant to this appeal, and otherwise affirmed.
. The appeal, taken by leave of this court, is limited to the question whether summary judgment was properly granted as to defendant’s counterclaims (see 45 NY2d 959).
. If defendant did indeed refuse to perform unless plaintiff complied with a condition which went beyond the contract, then defendant’s conduct would amount to a repudiation (see McKinney’s Cons Laws of NY, Book 6214, Uniform Commercial Code, § 2-610, Official Comment 2; Wester v Casein Co. of Amer., 206 NY 506, 512; National Farmers Organization v Bartlett & Co., Grain, 560 F2d 1350, 1356-1357; 4 Corbin, Contracts, § 973, at p 910). In such a case, plaintiff would have been entitled to suspend its own performance without committing an independent breach of the contract (Uniform Commercial Code, § 2-610, subd [c]; see Anderson, Repudiation of a Contract Under the Uniform Commercial Code, 14 De Paul L Rev 1, 14).