delivered the opinion of the court.
It must now be considered as settled, that a reservation of more than six per cent, per annum, upon a contract relating to past forbearance and giving day of payment of money, is not only within the words, but within the intent and meaning of our statute, entitled “ an act to restrain the taking of unlaw- “ ful interest.” Willie vs. Green, 2 N. H. Rep. 333.
The questions, which remain to be settled, are, whether the material allegations of the plea in this case were substantially proved ; and, if proved, whether they amount to a sufficient answer to the action ?
The substance of the plea is, that on the 29th June, 1814, the* defendant gave his note for $200, and interest ; that on the 10th January, 1818, he paid iu part $200 ; and that on the 16th March, 1820, it was corruptly agreed, that interest should be cast upon the note, at the rate of twelve per cent... and a new note be given for the balance found due, upon such a calculation ; and that J, Gibson affirmed, that there was *187due, on such a calculation, $113 24 ; and that this note was given for that sum.
The case states, that the first note was given ; that th e $SOO were paid ; that an agreement to cast the interest at twelve per cent, was made ; that the amount due upon such a calculation was found to be, and the present note made, as stated in the plea. The substance of the plea seems to us to have been clearly proved.
It seems, that there was some mistake in the calculation of interest ; for the sum mentioned in this note amounts to more than would have been due upon the first note, casting the interest at twelve per cent. ; and whatever may have been included by mistake cannot be deemed usurious. But it appears upon calculation, that the amount due upon the first note, at the time the second note was given, casting the interest in the usual manner, at six per cent, was $47 95. And as the case finds, that it was agreed to cast the interest on the note at the rate of twelve per cent., it is apparent, that, at least, the sum of $47 95 above lawful interest wras designedly included in this note ; and that three times that sum amounts to much more than can be legally due on this note.
The remaining question to be considered is, whether the matter of this plea is a sufficient answer to the action, in the form in which it is pleaded ?
To settle this question it is necessary to examine the statute.
It is very apparent, from the language of the second section, that the statute extends only to cases, where persons are sued upon “ any bond, contract, mortgage, or any assur- “ anee given or made for the payment of any money, goods, “ or personal estate.”
It is also very clear, that the statute embraces only those cases, where the illegal interest has been reserved, or secured for the forbearance of “ the money, or other per- “ sonal estate, or thing,” for which the suit is brought. It has never been held, that the action must be brought to recover the precise sum, on which the illegal interest was reserved or secured. But “ the thing sued for” must, at least, have been a part of the money or thing, to *188which the corrupt contract related. The better opinion is. that a mere substitution of another security for the one taint-cd with usury, between the parties to the corrupt agreement, does not take a case out of the statute. Moor 752.—Croke James 32.—Yelv. 47.—3 D. & E. 531.—8 ditto 390.—3 Esp. cases 23.—4 ditto 11.—9 Mass. Rep. 45.—10 John. 185.—1 Camp. 157.—Ord 103.—15 Mass. Rep. 96.
The amount of forfeiture, created by the statute, is u three “ times the sum above the lawful interest taken, secured, “ given, or received and the amount forfeited is to be deducted from u the sum lawfully due,” by or upon the contract, or other assurance tainted with the usury. Not only the money, on which the usury has been secured or taken, but the legal interest on that money is subject to the deduction.
In the case now under consideration, a portion of the illegal interest was received for the forbearance of $200, from the 29th June, 1814, to the 10th January, 1818, when the sum of $200 was received and endorsed upon the first note. This sum thus received is tobe considered as applied in the first place to the discharge of the interest agreed to be paid, and in the next place to the discharge of the principal, of the first note. The present note is to be considered as given for the balance of the principal of the first note remaining due after the application of the $200, as above stated, and the interest agreed to be paid on that balance. We think, that the $200, indorsed upon the first note, is to be considered as thus applied ; because it is customary to apply sums indorsed upon notes generally, without any particular appropriation, in the first place to the discharge of the interest. Part of the illegal interest in this case then was paid in the year 1818, and the residue is reserved and secured in the note, on which this action is founded.
It is very apparent, that the money “ sued for” in this action is composed, in the first place, of the balance remaining unpaid of the sum mentioned m the first note, and on which the illegal interest was received, and of the illegal interest reserved in the last note on that balance ; and that whatever is legally due in this case is composed of a portion of the principal, on which the illegal interest was received *189or reserved, and of interest on,that portion. We are therefore clearly of opinion, that the ease is within the intent of the statute, and that whatever is legally due on this note is subject to a deduction of three times the amount of what was received and of what was reserved, above six per cent, as stated in the plea.
But is this matter a good bar to the action ? It is very clear, that three times the amount of the illegal interest, which has been received and reserved in this case, much exceeds the sum that will remain due on the note, after the illegal interest is deducted. The whole amount due then may be considered as forfeited to the defendant. The plaintiff is entitled to recover nothing, if the defendant chooses to insist upon the forfeiture. We see no good reason, why the matter of this plea should not be considered as a good bar. It was always held, that where a debt was forfeited by the outlawry of the creditor, if he brought an action to recover the debt, the outlawry might be pleaded in bar. Lawes' Plead, in Assumpsit 685. That case cannot, in our opinion, be distinguished from the present. For the whole debt is in this instance forfeited as entirely, as it could be in a case of outlawry.
There is another view of this case, which leads to the same result. We are now considering the case after a verdict ; and we understand it to be clearly settled, that the court may and ought, ex-officio, to give such judgment on the whole record, as ought to be given, without regard to any imperfection in the prayer of judgment. Thus in Le Bret vs. Papillon, (4 East 502,) the defendant pleaded in bar of the action, that the plaintiff was an inhabitant of France, between which country and England war existed. The plaintiff replied, that at the time the action was commenced, peace existed between England and France. To this there was a demurrer. The court held, that the plea was bad, because the matter of it ought to have been pleaded in bar of the further maintenance of the action, and not in bar generally ; but as it appeared upon the whole, that the plaintiff was an alien enemy, the court gave judgment, that the plaintiff he ban ed from further maintaining his action. The same principle is *190distinctly recognized in Fraunces’ case, (8 Coke 177.—2 Strange 1055.—2 B. & P. 420, Powell vs. Fullerton.—1 Chitt. Plead. 445.)
In the case before us the usury is found by the jury, as alleged in the plea, and we entertain no doubt that, if it were necessary, we have the power, and that it would be our duty, to deduct three times the amount of the unlawful interest from the sum legally due, and to give judgment accordingly, in the same manner we might have done, had the defendant, instead of demanding judgment if the action should be maintained, prayed that such a deduction might be made.
We are therefore of opinion, that the defendant is entitled to
Judgment on the verdict.