This appeal was decided at the present term of this court, and is reported in 5 S. D. 539, 59 N. W. 833. A petition for a rehearing was filed, and, in view of the importance of the questions involved, we departed from our usual practice, and permitted oral arguments before the. court, in addition to the petition and reply thereto. The material portion of the answer to the alternative writ of mandamus issued in this cause is contained in the third paragraph and is as follows: ‘‘The defendants further allege that the city council has no power or authority whatever to incur the debt created by the contract upon which said judgment was obtained; that at the time the contract was signed, and at the time, the well was completed and liability incurred, the • city of Huron was indebted to more than four per cent, on the valuation of the taxable property of the city of Huron, limited by the law of the state of South Dakota, and was indebted to more than five per cent, on the value of the taxable property of the city of Huron, as limited by the constitution of the said state. * * *” The pleader then set out the indebtedness of the city of Huron, its taxable property, etc. To this paragraph the respondent demurred as follows: “(1) That the judgment obtained by the plaintiff against the defendant cannot be attacked in this collateral proceeding. (2) Because it does not state facts sufficient to constitute a defense to the action and proceeding.” There may be a question as to the regularity of interposing a demurrer in mandamus proceedings, but as no point is made as to the practice the demurrer may be treated as amotion to quash the proceedings, and we. shall so treat it for the purposes of this case. What disposition was made of this demurrer does not appear, but both counsel treat it as overruled or denied. *182We shall so treat it. It may be further stated that it is alleged in the answer that the judgment was rendered by default, no answer or demurrer having been interposed by the defendants, on the 10th day of July, 1891.
The alternative writ of mandamus bears date of August 80, 1893. It may here .be stated that the record in the original action is not before us, and the only allegation in the petition in regard to the claim of the plaintiff is “that the plaintiff recovered a. judgment against the aforesaid city of Huron for the sum of $3,734.10, including interest,” etc. The counsel for the appellants insists that by the demurrer it is admitted that, at the, time the debt was contracted on which the judgment was rendered, the city of Huron had exceeded its constitutional limitation of indebtedness, and that this defense to the cause of action was available to -the appellants, notwithstanding the j udgment of the court, and as against the same, in the proceeding by. mandamus to compel the city to levy a tax for its payment. The learned counsel for the appellants further contends that, it being admitted that the city had so exceeded its constitutional limit, the.contract was absolutely" void, for want of power in the city to make it, and that the provision of the constitution limiting the indebtedness that a city may contract cannot be defeated by changing the form of the indebtedness from that of an ordinary claim based upon contract to that of a judgment; and hence he insists that when it appeared to the court in this proceeding, by the allegation of the answer, and admitted by the demurrer, the court should have denied the peremptory writ. The counsel for respondent denies this proposition, and insists that the judgment conclusively determines the rights of the parties, and that the judgment cannot be assailed in this mandamus proceeding. The issue is thus sharply drawn between the counsel.
* The constitutional provision referred to is section 4, article 13, of the state constitution, and is as follows: “The debt of any county, city, town, school district or other subdivision, *183shall never exceed five per centum upon the assessed value of the taxable property therein.” It is conceded that the judgment was rendered by default. This, however, is not important, as a judgment by default is equally conclusive as a judgment upon an answer and verdict of a jury, or by a court in a trial had before it. The law as to the conclusiveness ol a judgment is clearly stated by the supreme court of the United States in Cromwell v. County of Sac, 94 U. S. 351, and the distinction between the effect of such a judgment as a bar or estoppel in the same action and as an estoppel or bar to another action is thus stated: “In considering the operation of this judgment, it should be borne in mind, .as stated by counsel, that there -is a difference between the effect of a judgment as a bar or estoppel against the prosecution, of a second action upon the same claim or demand, and its effect as an estoppel in another action between the same parties upon a different claim or cause of action. In the former case the judgment, if rendered upon the merits, constitutes an absolute bar to a subsequent action. It is a finality as to the claim or demand in controversy, concluding parties and those in privity with them, not only as to every matter which was offered and received to sustain or defeat the claim or demand, but as to any other admissible matter which might have been offered for that purpose. Thus, for example, a judgment rendered upon a promissory note is conclusive as to the validity of the instrument and the .amount due upon it, although it be subsequently alleged that perfect defenses actually existed, of which no proof was offered, such as forgery, want of consideration, or payment. If such defenses were not presented in the action, and established by competent evidence, the subsequent allegation of their existence is of no legal consequence. .The judgment is as conclusive, so far as future proceedings at law are concerned, as though the defenses never existed. The language, therefore, which is so often used, that a judgment estops, not only as to every ground of recovery or defense actually presented in the action, but also as to every *184ground which might have been presented, is strictly accurate, when applied to the demand or claim in controversy. Such demand or claim, having passed into judgment, cannot again be brought into litigation between the parties in proceedings at law upon any ground whatever. But, where the second action between the same parties is upon a different claim or demand, the judgment in the prior action operates as an estoppel only as to those matters in issue, or points controverted, upon the determination of which the finding or verdict was rendered. In all cases, therefore, where it is sought to apply the estoppel of a judgment rendered upon one cause of action to matters arising in a suit upon a different cause of action, the inquiry must always be as to the point or question actually litigated and determined in the original action, not what might have been thus litigated and determined. Only upon such matters is the judgment conclusive in another action.” In Harshman v. Knox Co., 122 U. S. 306, 7 Sup. Ct. 1171, the,same court quotes with approval the foregoing language of the court as to the conclusiveness of judgments in the same action, and says: “And as stated in Burlen v. Shannon, 99 Mass. 200, 203, ‘The estoppel is not confined to the judgment, but extends to all facts involved in it, as necessary steps or the groundwork upon which it must have been founded. ’ It is none the less conclusive because rendered by default. ‘The conclusiveness of the judgment upon the rights of the parties does in no wise depend upon its form, or upon the fact that the court investigated or decided the legal principles involved. A judgment by default or upon confession is, in its nature, just as conclusive upon the rights of the parties before the court as a judgment upon a demurrer or verdict. ’ Gifford v. Thorn, 9 N. J. Eq. 702, 722. The bar is all the more perfect and complete in this proceeding because it is* not a new action. 'Mandamus, as it has been repeatedly decided by this court, in such cases as the present, is a remedy in the nature of a execution for the purpose of collecting the judgment. Riggs v. Johnson Co., 6 Wall. 166 *185Supervisors v. Durant, 9 Wall. 415; Thompson v. U. S. 103 U. S. 480, 484. Certainly, nothing that contradicts the record of the judgment can be alleged in a proceeding at law for its collection by execution. ” '
The law laid down in these decisions seems to be thd settled law upon the question, and establishes the rule that judgments are not only conclusive upon all matters litigated, but those that could have been litigated in the action, with perhaps two exceptions, which will be hereafter noted. The counsel, in his petition, lays down the proposition ‘‘that it is well settled that, before a debt is put into judgment, it is a good defense to plead the constitutional limitation to such indebtedness.” This is undoubtedly a correct proposition of law. But it is this fact, that the constitutional limitation might have been so pleaded as a defense before judgment, though it was not, that renders the judgment conclusive upon the question as to the validity of plaintiff’s claim or contract, and the liability of the defendant for its payment. Suppose the city of Huron had pleaded the defense now sought to be interposed, namely, that the contract upon which the plaintiff sought to recover was made after the city had incurred the full amount of indebtedness permitted by the constitution, and that said contract was therefore void, and no judgment could be rendered against the city therefor, and that after a trial, and full discussion of the facts and law involved, the court had determined that the city had not, when said debt was contracted, exceeded the constitutional limitation, and therefore rendered judgment in favor of the plaintiff and against the city for the amount claimed, from which no appeal had been taken, and more than two years had elapsed since its rendition. Would the learned counsel, in such a case, claim that on mandamus proceedings to enforce that judgment the defendant could again set up the same defense, and ask to have it again litigated? We think not. He would hardly presume to raise the question in such a case. But is not the judgment in the case at bar precisely as *186conclusive as an estoppel or bar as though the defense had actually been, pleaded? It seems to us that under the decisions it was, and that neither the fact that no answer was interposed, nor that this defense was pleaded, changes the case, or weakens the conclusive effect of the judgment. In other words, in theory, the law says that all those defenses that might have been interposed were so interposed, and passed upon by the court. Where a party has had his day in court, and an opportunity to make any defense that he may have to an action, and he makes such defense, and it is decided adversely to him, or he fails to interpose any defense, he cannot afterwards be heard to question the judgment rendered in the action, except in a direct proceeding for that purpose, except when the judgment has been procured by the fraud of the parties, or the judgment record, upon its face, shows that the contract upon which the judgment was rendered was absolutely void.
We shall now briefly review some of the cases cited by counsel, which at first view seem to support his position, for the purpose of ascertaining whether or not they sustain the contention ofcounsel, when carefully examined.
The leading case that comes the nearest to sustaining the theory of counsel is Kane & Co. v. Independent School Dist., 47 N. W. 1076, 82 Iowa 5. In that case the defendant, in its return to the writ of mandamus, set up that the judgment was obtained by the fraud and collusion of the plaintiff and the former officers of the school district; and that the contract was invalid on which the judgment was entered, and the defendant, in a cross bill, set up the same facts, and asked to have the judgment vacated. This proceeding, it seems, under the laws of Iowa, was permissible, as the statute of that state provides that an action to vacate and cancel a judgment may be brought within one year after the entry of judgment. School Dist. v. Schreiner, 46 Iowa, 172. The decision of the court below was in favor of the defendant, and the judgment was ordered to be vacated. This decision of the lower court was sustained. It is *187true the supreme court said, “There is no direct evidence upon which to base a finding that the judgment was procured, by collusion between the plaintiff and directors of the district. ” But the court was evidently satisfied with the finding based upon the circumstantial evidence in the case, as the court, in its opinion, says: “But fraud or collusion is not required to be shown by direct evidence. It may be proved by facts and circumstances, and in our opinion the evidence in this case shows that both parties to that action intended that the plaintiff should recover judgment. Having found that the judgment was a fraud upon the district, the next question to be determined is, can the district be relieved from the payment of the judgment?” The court then holds that it could. It will thus be seen that this case does not support the counsel’s contention, for in the case at bar no fraud or collusion is alleged, and no proceedings were taken to set aside the judgment, though more than two years had elapsed between the date of the entry of the judgment and the institution of the mandadus proceedings. The only facts alleged are that a judgment was rendered upon default, or, in other words, that the city had a good defense to the action, but neglected to plead it, and that a judgment wa's entered without any answer on the part of the defendant.
The next case cited that seems to support the contention of the counsel is Kelley v. Milan, 127 U. S. 139, 8 Sup. Ct. 1101. A suit in equity was brought by the authorities of the city of Milan to enjoin perpetually the collection of certain bonds issued by that town. The mayor, before the case was tried, consented to a decree against the town, which was accordingly entered under the stipulation. In a subsequent action on these bonds this decree was pleaded as a bar to the action. Upon the subject of this decree the court says: ‘‘This was no adjudication by the court of the validity of the bonds, on the submission to it, as a judicial tribunal, of the question of such validity. The declaration of the validity of the bonds, contained in the decree, was made solely in pursuance of the consent to that *188effect contained in the .agreement signed by the mayor of the town and the officer of the New Orleans, St. Louis & Chicago Railroad Company. The act of the mayor in signing that agreement could give no validity to the bonds, if they had none at the time the agreement was made. The want of authority to issue them extended to a want of authority to declare them valid. The mayor had no such authority. The decree of the court was based solely upon the declaration of the mayor, in the agreement, that the bonds were valid; and that declaration was of no more effect than the declaration of the mayor, in the bill in chancery, that the bonds were valid. The adjudication in the decree cannot, under the circumstances, be set up as a judicial determination of the validity of the bonds. Russell v. Place, 94 U. S. 606; Insurance Co. v. Broughton, 109 U. S. 121, 125, 3 Sup. Ct. 99. This was not the case of a submission to the court of a question for its decision on the merits, but it was a consent, in advance, to a particular decision, by a person who had no right to bind the town by such a consent, because it gave life to invalid bonds, and the authorities of the town had no more power to do so than they had to issue the bonds originally. There is nothing inconsistent with this view in Nashville, C. & St. L. Ry. Co. v. U. S. 113 U. S. 261, 5 Sup. Ct. 460, where it was held -that a decree in equity, by consent of parties, and upon a compromise between them, was a bar to - a subsequent suit upon a claim therein set forth as among the matters' compromised and settled, although not in fact litigated in the suit in which the decree was rendered. In that case both parties had full power to make the compromise involved. The judgment of the circuit court is affirmed.” It will be noticed that in that decree was recited the stipulation upon which it was based. It did not purport to be the judgment of the court upon the facts, but was based entirely upon the stipulation. It may be added that in that case it was alleged in the answer that the judgment was entered by the fraudulent collusion of the mayor and the plaintiff in that action, though this feature of the case is not discussed in the opinion.
*189The decision in the cáse of Harshman v. Knox Co., 122 U. S. 306, 7 Sup. Ct. 1171, is thus explained by the supreme court of the United States in Commissioners of Taxing-Dist. of Brownsville v. Loague, 129 U. S. 493, 9 Sup. Ct. 327, and the views of that court in the latter case stated. Speaking of the Harshman case, the court says: “But the power to issue the bonds was not questioned. The controversy was as to the rate of taxation, depending upon which act they were issued under. If the original contract could have been resorted to, the decision might have been otherwise as 1o the rate; but it was held that that could not bo done, because, from the averments which formed part of the complete judgment record, it appeared that the bonds were issued under one act, rather than the other, while each of the acts fully authorized the issue, and gave the power to tax to pay.” And the court then adds: “But in the case at bar it appeared from the judgment records — or, if not, from relator’s petition — that the bonds were issued under an abrogated statute, and were consequently void, and that the respondents possessed no power to tax to pay them, because that power was given only hy the statute which had so ceased to exist. The power invoked is not the power to tax to pay judgments, but the power to tax to pay bonds, considered as distinct and independent; and therefore, when the relator is obliged to go behind his judgments, as money judgments merely, to obtain the remedy pertaining to the bonds, the court cannot decline to take cognizance of the fact that the bonds are utterly void, and that no such remedy exists. Res judicata may render straight that which is crooked, and black that which is white, — ‘Facit ex curvo rectum, ex albo nigrum’ — (Jeter v. Hewitt, 22 How. 352, 364); but where application is made to collect judgments by process not contained in themselves, and requiring, to be sustained, reference to the alleged cause of action upon which they are founded, the aid of the court should not be granted, when, upon the face of the record, it appears, not that mere error supervened in the rendition of such judg*190ments, but that they rest upon no cause of action whatever.” This'same doctrine is laid down in Bank v. Partee, 99 U. S. 325. In the case at bar the petitioner for the writ of mandamus sets forth no facts showing that the city of Huron had contracted debts in excess of the constitutional limit when the debt for which judgment was rendered was incurred by the city, and it is not contended that the judgment rendered in this case discloses any such facts; hence, this court has nothing before it upon which it could declare the contract void, even assuming that it was so, unless we permit the appellant to collaterally impeach this judgment. This, as we have seen, w$ cannot do. The language of Chief Justice Puller in the Brownsville case, that ‘‘the aid of the court should not be granted when, upon the face of the record, it appears, not that mere en-or supervened in the rendition of such judgments, but that they rest upon no cause of action whatever,” is very suggestive, and shows clearly the basis upon which the decision rests, and that it rests entirely .upon the fact that the record itself discloses that there was no cause of action whatever. As before stated, there is nothing in the record before us, nor do we understand it is claimed that there is anything in the original judgment, that would show that plaintiff’s contract was illegal, void, ór in contravention of the constitutional provision.
There is one other decision (Wilder v. Commissioners, 41 Fed. 512) that should be noticed, as there is language used by Judge Hallett, of the United States circuit court of Colorado, .that seems to support appellant’s contention. That learned judge, however, seems to base his remarks — not. necessary in the decision of the case — upon the Brownsville case, supra, and Bank v. Partee, supra; thus indicating that if the judgment, upon its face, was void, or not founded upon any' cause- of action whatever, the appellant in that case might have succeeded in defeating the mandamus.
We are unable to discover anything under which the contention of the appellant can be sustained, unless ¶ e take from *191j uclgments the sanctity with which the law has clothed them, and hold them subject to attack in mandamus proceedings to enforce them. As we have said, if the judgment was obtained by collusion and fraud, and it so appeared from the record before us, possibly it might be subject to attack upon that ground, as held in the Iowa case; or if the judgment record showed upon its face that it was a void judgment, being based upon no cause of action whatever, as held in the Brownsville case, and in Bank v. Partee, 99 U. S. 325, we might, under the rule laid down in those cases, if the judgment record were before us, be justified in following them. But the record before us is such that we are compelled to give the judgment in this case the conclusive character that judgments ordinarily possess. From that record it appears that plaintiff duly obtained a judgment against the city of Huron upon default; that after more than two years the plaintiff seeks to collect the judgment by mandamus proceedings, to compel the city council of that city to levy a tax to pay the same, and that the city now seeks to interpose a defense that could have been made in the action, but which the city failed to make. In our view of the case the city is concluded by the judgment, and cannot now interpose any such defense. It bas-had its day in court, and it has allowed the time for interposing its defense to pass. It cannot now be permitted to plead a defense it might have pleaded at the proper time, but declined or neglected to do. It cannot now be heard to say that the contract upon which the judgment is claimed to have been founded was not a valid and binding contract against rhe city. The judgment estops the city from asserting the fact-to be otherwise. In theory of law, therefore, the assertion of the city cannot be true.
Counsel for the appellants further contend that the decision of the court is erroneous in holding that the demand in this case was sufficient to support the peremptory writ of mandamus issued in this case. We are of the opinion, however, that there is no error in the opinion, in holding as stated. The per*192emptory writ, while not following the demand made upon the mayor and common council in terms, does include a part of the relief claimed in the demand. The fact that it does not include all the relief demanded does not invalidate the writ. In Smith v. Lawrence, 2 S. D. 185, 49 N. W. 7 (a mandamus case), this court said: “Though plaintiff may have demanded greater relief than he is entitled to by law, the court may grant him the relief to which he is entitled under the facts stated.” Of course, the relief granted must be included within the terms of the demand, but it may be less. In the case at bar the demand was that the city council “levy such a sum of money as will be sufficient to pay the debt and judgment, and interest thereon,” specifying the judgment, amount, etc. The alternative writ followed the terms of the demand. On the return, answer, and hearing, the court modified the terms stated in the alternative writ, and only required the city council to make a levy to the full extent of 10 mills, as limited by the city charter, and required the city to pay on the judgment any balance remaining in any of its city funds after the current expenses of the city for the fiscal year had been paid in full. This we are of the opinion the court was authorized to do, as the relief granted was clearly within the scope of the demand, and was less than the relief'demanded. If, on the return, the municipality had manifested a willingness to make such a levy, and apply its surplus funds as directed by the court in its peremptory writ, the court could have refused the writ, or relieved the city of the payment of costs. But the city denied its liability to pay the judgment in any manner, by a levy of taxes or otherwise, and hence the issuance of the peremptory writ for the less relief than that demanded was proper. The rule adopted in the early cases, that the peremptory writ must follow the precise terms of the alternative writ, or be denied, is not followed by.some of the courts in their later decisions. The rigid and inflexible rule of the common-law courts, as laid down in the earlier cases, is not in harmony with the more liberal and advanced system *193of procedure now in force in many of the states. When the court has jurisdiction of the parties and of the subject-matter, it should, if possible, determine the controversy between the parties; and we think the nature of the reformed system in force in this slate permits this, under reasonable limitations, to be done.
We fully agree with the reasoning of the learned supreme court of Ohio in State v. Crites, 48 Ohio St. 142, 26 N. E. 1052. In that case the court says: “(4) The earlier doctrine in mandamus was that the peremptory writ should strictly follow the alternative one. That rule, in all its strictness, is still followed in many of the more modern cases. * * * Valid reasons for this rigid rule are not at all apparent. The civil remedy by mandamus is to enforce civil rights, and why the proceeding therein should not be as elastic as in civil actions has not been satisfactorily answered b'y the oases that adhere to the rule. In civil actions no one would be heard to contend, at this late day, that, because the plaintiff had claimed more than upon the trial he could maintain, it would be fatal to his right to recover that to which he was bntitled upon the facts and the law as they appeared upon the trial. In mandamus, it is so much less difficult for a party to determine in advance the exact measure of his rights, that if he makes a mistake in that regard, by claiming more than he can maintain upon the trial, he is to be sent out of court, mulcted in costs, and compelled to begin de novo? If he claims less than his right, no more than is claimed will be awarded him. If the rule should be maintained in all its strictness, the remedy of mandamus will be a perilous one to invoke in cases where more than a single act or right is sought to be enforced. If less than his full right is claimed by a party, he will not recover that npt claimed, but must encounter the delay of another proceeding, and the hazard of a plea of res adjudícala in respect of it, while if he claims too much he will be denied any relief whatever, however clearly his title may *194appear to a large part of his demand. In many cases courts have sought to escape from the extreme severity of the rule,— in some instances by holding the difference between the two writs to consist of immaterial matters of detail, while in others an amendment of the alternative writ was allowed, making it conform to the peremptory writ. State v. Acting Board of Aldermen, 1 S. C. 31; State v. Weld, 39 Minn. 426, 40 N. W. 561; State v. Baggott, 96 Mo. 63, 8 S. W. 737; 2 Dill. Mun. Corp. (3 Ed. )§ 879. * * * Treating the petition, and the alternative writ based upon it, as the foundation of the relator’s claim, bearing the same relation to the proceedings in mandamus that the petition does to the proceedings in a civil action, and it is clear he is entitled to no relief beyond that which the petition and the alternative writ show him entitled to, and if he wishes other relief he must, as in civil actions., set forth by an amendment the facts that establish his right to it; but where, upon the trial, he is able to establish by proof, or maintain in law, his title to a part only of the relief sought, there seems now to be no reason for refusing to grant so much thereof as, under the facts and law, he is entitled to, without first amending the alternative writ. The alternative writ has commanded him to do all the acts enumerated in it, or show cause for his refusal; but, if he has only shown a legal excuse for not doing one of them, it would seem, in the nature of things, to be no defense for omitting to do others, unless there is such dependence between them that all stand or fall together. This principle was recognized by this court in State v. Board of Public Works, 36 Ohio St. 409, where the petition and the alternative writ founded on it were for the payment of a sum of money and interest, but upon the final hearing this court denied the relator’s demand for interest, and granted a peremptory writ for the principal only. State v. Board of Education, 42 Ohio St. 379. * * *” We have quoted quite largely from the decision of the Ohio supreme court, for the reason that the decision is a late one (made in 1891), and the question is fully discussed, and *195because in Ohio the practice is under a system quite similar to our own. We are of the opinion that the peremptory writ issued by the court below was fully warranted by the demand, alternative writ, and the facts before the court, and that this court committed no error in confirming the decision of the circuit court upon that ground.
It is next contended by the counsel for appellants that by the terms of the peremptory writ the circuit court directed the diverting of the funds of the city, collected for one purpose, to another, in violation of section 2 of article 10 of the state constitution, which provides, “Nor shall money raised by taxation, loan or assessment for one purpose ever be diverted to any other.” This provision, like all other constitutional provisions, should receive a reasonable construction. While the purpose for which the tax is levied, loan or assessment made, is not fully accomplished, the money so raised cannot be diverted to any other purpose; but after all the money required has been applied to the payment or discharge of the obligation for which it was levied or raised, and a balance remains, we think there would be no violation of the constitutional provision to apply such remaining balance to any legitimate purpose. This was the view evidently taken by the learned circuit court in requiring the municipal financial officers to apply upon the judgment of the plaintiff any balance remaining in any fund of the city after the current city expenses of the fiscal year have been paid. There may be some difficulty in ascertaining such balances, but that does not effect the question of the power of the court to direct the payment of the same upon the judgment, when in fact there shall be such balance after paying the expenses of the city for the current fiscal year. The duty of a city to provide for and pay a judgment against the city is equally as obligatory upon the city as the payment of any other city indebtedness, and the surplus revenues of the city are not diverted when balances remaining in any of the funds, not required for the current' expenses, are applied to the payment of *196such, judgment. It will therefore be seen that, in the view we take of the case, the former decision of this court is clearly correct, and that no decision or rule of law called to our attention would authorize any other decision. Feeling satisfied that no rehearing in this case would change our opinion, the petition for rehearing must therefore be denied. It is due to both of the counsel in this case' to say that their researches and arguments have been able, full, and exhaustive, and that by their labors they have very greatly aided the court in the examination of the questions presented.