
664 P.2d 986 (1983)
99 N.M. 788
EVANS FINANCIAL CORPORATION, a Washington corporation, Plaintiff-Appellee Counter-Defendant,
v.
Paul STRASSER and Eliza Paiz, Defendants-Appellants Counter-Plaintiffs,
v.
EVANS PRODUCTS COMPANY, and its division, Capp Homes, Additional Counter-Defendants.
No. 14802.
Supreme Court of New Mexico.
June 16, 1983.
Ronald C. Morgan, Albuquerque, for defendants-appellants, counter-plaintiffs.
Sutin, Thayer & Browne, Phillip R. Schichtel, Albuquerque, for plaintiff-appellee, counter-defendant.

OPINION
STOWERS, Justice.
This matter is before this Court upon certification from the Court of Appeals pursuant to Section 34-5-14(C), N.M.S.A. 1978 (Repl.Pamp. 1981). The question certified to this Court is whether parties to a suit in *987 equity have a right to a jury trial when their counterclaim involves legal issues. In our opinion they do.
The issue presented in this case arose in the following manner. Plaintiff-Appellee and Counter-Defendant Evans Financial Corporation (Evans) sought to foreclose two mortgages and to recover on three promissory notes. The parties agree that the complaint sought relief under the equity jurisdiction of the trial court and no jury trial issue arose at that point. Defendants-Appellants and Counter-Plaintiffs Strasser and Paiz (Strasser and Paiz) filed an answer and counterclaim. At the same time Strasser and Paiz filed a third-party complaint against Evans Products Company and its division, Capp Homes. The third-party complaint alleged that these third-party defendants were affiliated with Evans Financial Corporation and that "an agency relationship existed between them during this transaction." Three days later Strasser and Paiz also moved that the third-party defendants be joined as parties to the action. Evans then moved to dismiss portions of the counterclaim and moved for a more definite statement as to portions of both the answer and counterclaim. The parties later agreed to dismiss the third-party complaint. Evans Products Company and Capp Homes were then added as counter-defendants. See N.M.R.Civ.P. 13(h) and 19, N.M.S.A. 1978 (Repl.Pamp.1980). Thereafter, Strasser and Paiz were permitted to file an amended counterclaim.
Four days after filing the amended counterclaim, Strasser and Paiz filed a demand for a six-person jury. Evans moved to strike the jury demand on the ground that Strasser and Paiz had no right to a jury trial "as a matter of New Mexico law." Evans then answered the amended counterclaim. See N.M.R.Civ.P. 7(a), N.M.S.A. 1978 (Repl.Pamp.1980).
The trial court struck the jury demand, and the Court of Appeals granted an interlocutory appeal. Because the question presented involves a significant question of law under the Constitution of New Mexico and because it is a question of substantial public interest, the Court of Appeals certified the matter to this Court. See § 34-5-14(C), N.M.S.A. 1978 (Repl.Pamp.1981).
The New Mexico Constitution provides as follows: "The right of trial by jury as it has heretofore existed shall be secured to all and remain inviolate." N.M.Const. art. II, § 12. The phrase "as it has heretofore existed" refers to the right to jury trial as it existed in the Territory of New Mexico immediately preceding adoption of the Constitution. State ex rel. Bliss v. Greenwood, 63 N.M. 156, 315 P.2d 223 (1957); State v. Sweat, 78 N.M. 512, 433 P.2d 229 (Ct.App.1967). The common law jury trial existed in the Territory of New Mexico prior to adoption of the Constitution. See Walker v. New Mexico & Southern Pacific Railroad, 165 U.S. 593, 17 S.Ct. 421, 41 L.Ed. 837 (1897); Pankey v. Ortiz, 26 N.M. 575, 195 P. 906 (1921); see also Organic Act Establishing the Territory of New Mexico, September 9, 1850, ch. 49, 9 Statutes at Large 446, § 17, N.M.S.A. 1978 (Vol. 1, Pamp. 3); Bill of Rights as Declared by Brigadier General Stephen W. Kearny, September 22, 1846, cl. 5, N.M.S.A. 1978 (Vol. 1, Pamp. 3). The Organic Act, supra § 10, preserved the distinction between common law and chancery jurisdiction, that is, the distinction between legal and equitable issues. See Browning v. Estate of Browning, 3 N.M. (Gild. E.W.S. ed.) 659, 9 P. 677 (1886); Leitensdorfer v. Webb, 1 N.M. (Gild.) 34 (1853), aff'd, 61 U.S. (20 How.) 176, 15 L.Ed. 891 (1857). If the remedy sought is legal, parties are entitled to a jury trial; if the remedy sought is equitable, there is no jury trial as of right. See Pankey v. Ortiz, supra.
Evans asserts, however, that the New Mexico case of Young v. Vail, 29 N.M. 324, 222 P. 912 (1924), establishes that the New Mexico Constitution does not guarantee a right to jury trial in a mortgage foreclosure action, on legal issues raised in a cross-complaint. Young v. Vail held that there was no right to jury trial on a legal defense asserted in an answer to a complaint seeking equitable relief, and no right to a jury trial on legal claims asserted as permissive or voluntary cross-claims or counterclaims *988 asserted in the same action. Evans argues that Young v. Vail also applies to compulsory counterclaims. We find it important to note that the rules under which Young v. Vail was decided differ significantly from the modern civil rules. See §§ 4115, 4116, N.M.S.A. 1915.
The current rule in New Mexico regarding compulsory counterclaims reads in relevant part as follows:
A pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject matter of the opposing party's claim and does not require for its adjudication the presence of third parties of whom the court cannot acquire jurisdiction.
N.M.R.Civ.P. 13(a), N.M.S.A. 1978 (Repl.Pamp.1980) (emphasis added). Because Rule 13(a) states that "[a] pleading shall state as a counterclaim," it is mandatory in its directive. See § 12-2-2(I), N.M.S.A. 1978. Strasser and Paiz assert that the right to a jury trial should not be governed by who wins the race to the courthouse. We agree.
New Mexico's rule regarding counterclaims is similar to Rule 13 of the Federal Rules of Civil Procedure. See Fed.R. Civ.P. 13. The leading federal case dealing with the question before us is Beacon Theatres, Inc. v. Westover, 359 U.S. 500, 79 S.Ct. 948, 3 L.Ed.2d 988 (1959). In that case Beacon Theatres, Inc. sought by mandamus to require a district judge to vacate certain orders alleged to deprive it of a jury trial of issues arising in a suit brought against it by Fox West Coast Theatres, Inc. The Court of Appeals for the Ninth Circuit refused the writ. The United States Supreme Court reversed, however, noting, "`Maintenance of the jury as a fact-finding body is of such importance and occupies so firm a place in our history and jurisprudence that any seeming curtailment of the right to a jury trial should be scrutinized with the utmost care.'" Id. at 501, 79 S.Ct. at 952 (quoting Dimick v. Schiedt, 293 U.S. 474, 486, 55 S.Ct. 296, 301, 79 L.Ed. 603 (1935)). The Court continued by stating that "`[i]n the Federal courts this [jury] right cannot be dispensed with, except by the assent of the parties entitled to it * * *.'" Beacon Theatres, Inc., supra 359 U.S. at 510, 79 S.Ct. at 956 (quoting Scott v. Neely, 140 U.S. 106, 109-10, 11 S.Ct. 712, 713-14, 35 L.Ed. 358 (1890)). Only under the most imperative circumstances can the right to a jury trial of legal issues be lost through prior determination of equitable claims. Beacon Theatres, Inc., supra.
In a more recent case, the Court of Appeals for the Ninth Circuit issued a writ of mandamus directing the district judge to afford defendant a jury trial on his counterclaim for breach of contract. Myers v. United States District Court, 620 F.2d 741 (9th Cir.1980). In answer to plaintiff's contention that the counterclaim was primarily equitable, the court of appeals stated that it would not deny defendant a jury trial on his legal counterclaim merely because it was incidental to his equitable claim. The court stated that defendant was "constitutionally entitled to a jury determination of any `legal' issues raised in his counterclaim." Id. at 744.
Other state courts have discussed the issue that is before this Court. The Supreme Court of Utah, for example, addressed the question of what right counterclaimants have to a jury trial of legal issues in Dugan v. Jones, 615 P.2d 1239 (Utah 1980). Similar to the issues before this Court, Dugan involved a mortgage foreclosure action in which defendants counterclaimed with legal issues. Reversing the court below, the Utah court held that the defendant was entitled to have a jury decide its legal claims. Id.; see also Connell v. Bowes, 19 Cal.2d 870, 123 P.2d 456 (1942); Sanguinetti v. Strecker, 94 Nev. 200, 577 P.2d 404 (1978); Garrett v. Kennedy, 193 Okla. 605, 145 P.2d 407 (1943); but see Farmers Bank & Trust Co. v. Ross, Ind. App., 401 N.E.2d 74 (1980) (once equity has the case, even a counterclaim sounding in law must be tried under the umbrella of equity).
We find that the right to a jury trial is an important constitutional guarantee *989 in New Mexico. See N.M.Const. art. II, § 12. Therefore, counter-claimants may not have their right to a jury trial automatically abrogated upon the actions of others. Unless the jury trial is waived, see N.M.R. Civ.P. 38(a) and (d), N.M.S.A. 1978 (Cum.Supp.1982), legal issues should be tried by juries and equitable issues tried by the court. See Baca v. Anaya, 14 N.M. 382, 94 P. 1017 (1908); see also Basey v. Gallagher, 87 U.S. (20 Wall) 670, 22 L.Ed. 452 (1874) (relief that law affords must be administered through the intervention of a jury unless a jury is waived); see generally 5 J. Moore, Moore's Federal Practice ¶ 38.14 (2d ed. 1982) (discusses legal counterclaims in an "equitable" action). When the applicable rule of procedure requires or allows the defendant to assert as a counterclaim any claim he has against the plaintiff if it arises out of the subject matter of the original action, the defendant is entitled to a jury trial of the legal issues presented in the counterclaim. The equitable issues remain within the exclusive province of the court. To the extent that Young v. Vail is contrary to our opinion on this question, it is hereby specifically overruled. Furthermore, to the extent that other prior decisions of this Court are contrary to this opinion, they are overruled. See, e.g., Martinez v. Mundy, 61 N.M. 87, 295 P.2d 209 (1956); Quintana v. Vigil, 46 N.M. 200, 125 P.2d 711 (1942).
This case is remanded to the trial court for proceedings consistent with this opinion.
IT IS SO ORDERED.
PAYNE, C.J., SOSA, Senior Justice, and RIORDAN, J., concur.
FEDERICI, J., concur specially.
FEDERICI, Justice, specially concurring.
I concur with the result reached in the opinion. However, in order to emphasize the distinction between the rule applicable to equitable and legal issues and the right to a trial by jury of the legal issues only, I would respectfully point out that this Court has consistently held for decades that in suits involving equitable issues, there is no jury trial as a matter of right. The equitable issues are heard first by the court and if any legal issues remain they can be heard by a jury upon appropriate request. Martinez v. Mundy, 61 N.M. 87, 295 P.2d 209 (1956); Quintana v. Vigil, 46 N.M. 200, 125 P.2d 711 (1942); Young v. Vail, 19 N.M. 324, 222 P.2d 912 (1924); Pankey v. Ortiz, 26 N.M. 575, 195 P. 906 (1921).
I cannot concur with the opinion insofar as it completely overrules Young. In Young, the Court held that a defendant in a foreclosure suit who voluntarily interposes a cross-complaint of a legal nature is not entitled to a jury trial of the issues raised thereby. I concur with the majority that this statement of the law in Young should be overruled; however, as to the remainder of the opinion in Young, I would overrule only to the extent that it is inconsistent with this opinion.
