The opinion of the court was delivered, by
Sharswood, J.That a party who, when threatened with a distress, pays an illegal tax under protest and notice of suit, may maintain an action to recover it back, is settled in this state: *435Henry v. Horstick, 9 Watts 414; Caldwell v. Moore, 1 Jones 60; Allentown v. Saeger, 8 Harris 421.
We will assume, for the purpose of this opinion, that at the time the taxes here in question were levied, the school-board of Weissenberg township had no lawful authority to assess and collect them. We are brought thus at once to the question, whether the Act of the General Assembly, passed August 25th 1864, Pamph. L. 1027, entitled “ An Act relative to the payment of bounties in the township of Weissenberg, Lehigh county,” was constitutional.
After reciting that the said township had held a public meeting, when it was resolved that a per capita tax of $5 be levied, and that the school directors of said township levy an income tax according to the business and income of the inhabitants, in addition to the amount levied on the assessment, and that doubts had arisen as to the validity of the tax, it is enacted “ that the taxes imposed by the said township of Weissenberg, in relation to the payment of bounties, are hereby legalized and made valid.”
The argument for the unconstitutionality of this act is placed on this ground: that at the time of its passage the plaintiff had a vested right to recover back from the township the money which he had been compelled to pay without authority of law; and this vested right the legislature could not divest.
If an Act of Assembly be within the legitimate scope of legislative power, it is not a valid objection that it divests vested rights. There is no clause, either in the Constitution of the United States or of this Commonwealth, which prohibits retrospective laws. The legislature Gannot impair the obligation of a contract, or pass an ex post facto law, for both these are expressly forbidden. But an ex post facto law is one which makes an act punishable in a manner in which it was not punishable when it was committed: Fletcher v. Peck, 6 Cranch 138. Ex post facto laws relate to penal and criminal proceedings, which impose punishments or forfeitures, and not to civil proceedings, which affect private rights retrospectively. Retrospective laws and state laws divesting vested rights, unless ex post facto or impairing the obligation of contracts, do not fall within the prohibition contained in thev Constitution of the United States, however repugnant they may be to the principles of sound legislation: Calder v. Bull, 3 Dallas 386; Satterlee v. Matthewson, 2 Peters 413; Watson v. Mercer, 8 Peters 88. Neither are they expressly or impliedly forbidden in any section of the ninth article or declaration of rights of the Commonwealth of Pennsylvania. All acts curing irregularities in legal proceedings, necessarily divest vested rights of the parties, by closing the mouths of those who could otherwise avail themselves of such irregularities to escape from the fulfilment of what is a moral obligation; and, but for the irregularity, would be a legal liability. So wherever formal defects in the *436execution or acknowledgment of deeds, mortgages or other conveyances, are remedied by legislation, those who might have pleaded and relied on such defects are debarred of that which would otherwise have been a legal vested right. To deny the validity of such laws would be to run the ploughshare through hundreds of titles which are founded and repose in security upon them. ’ Thus an act curing an irregularity in the entry of a judgment, was held to be within the legitimate province of the legislature in Underwood v. Lilly, 10 S. & R. 97. The various acts passed at different times, rendering valid defective acknowledgments of deeds by married women, whether merely to bar the right of dower or to convey their own estate in fee simple, so as to make such deeds, which would otherwise be void, good against them and their heirs, have been solemnly decided to be constitutional in Tate v. Stoolfoos, 16 S; & R. 35, and Mercer v. Watson, 1 Watts 330. In the case last cited the heirs of the wife had recovered the land and remained in possession of it seventeen years; when, after the passage of an act curing the defect, the alienee brought ejectment, and judgment was finally given in his favor. These cases have never since been questioned, that I am aware of; but on the contrary have been repeatedly cited with approbation, both by bench and bar: Linn’s Analytical Index. Even in the able dissenting opinion of Judge Duncan, in Satterlee v. Matthewson, 16 S. & R. 191, one of the last judicial efforts of that most learned judge and sound and conservative lawyer, al that time, as he declares, the oldest living member of the profession in the state, and in which he advanced views which have since been adopted and established by this court, the authority of the cases I have referred to is distinctly admitted.
The judicial current, indeed, for a long period ran riot in sustaining acts of legislation of the most extreme character. Retroactive legislation began and was continued because the judiciary thought itself too weak to withstand; too weak, because it had neither the patronage nor the prestige to sustain it against the antagonism of the legislature and the bar. This, at least, is the account which C. J. Gibson gave of the matter in Greenough v. Greenough, 1 Jones 489-495, and his testimony is certainly worthy to be implicitly received, for he could truly say, quorum pars magna fui. In Harvey v. Thomas, 10 Watts 66, he had himself gone the length of asserting that the legislature had power to take the property of an individual, even for a private purpose and without compensation. — In other words, could take the property of A. and give it to B.; but in Norman v. Heist, 5 W. & S. 174, he himself, with characteristic frankness, repudiated such a doctrine. So Braddee v. Brownfield, 2 W. & S. 271, was overruled in De Chastelling v. Fairchild, 3 Harris 18, and Menges v. Wertman, 1 Penna. R. 218, ted in Menges v. Rentier, 9 Casey *437495. These were cases lying on the extreme verge of legislative power, and it is evident that the judicial current was turned backward. I may venture to say, as I think, that Satterlee v. Matthewson would not now be decided as it was in 1827; and that the opinion of Judge Duncan, composed, as he informed us, during intervals of relief from pain, when the last sands of his long and noble life were running out, and in which he contended as though it were pro aris et focis, would better express the ripened judgment of the profession and the courts.
To exercise judicial power is not within the legitimate scope of legislative functions; and when vested rights are divested by acts of that character, they will and ought to be adjudged inoperative, null and void: Bagg’s Appeal, 7 Wright 512. It would be a nice and difficult task to trace accurately the boundary line between the domains of authorized and prohibited legislation on this subject. But the case now before us is far removed from the borderland of controversy. The power of taxation is a necessary and indispensable incident of government. It also has limits, but they are broadly marked and well defined. That it may be local and special as well as general, it is entirely too late at this day to question. Yet an act of the legislature authorizing contributions to be levied for a mere private purpose, or for a purpose which, though it be public, is one in which the people from whom they are to be exacted have no interest, would not be a law, but a judicial sentence, and not within the legitimate scope of legislative authority: Sharpless v. The Mayor, 9 Harris 147. Within this limit the power of the legislature to impose taxes, or to authorize their imposition by subordinate municipal authorities, is of necessity discretionary. To permit its wisdom, policy or even equality to be questioned judicially, would be to stop the wheels of government. Perfectly equal taxation will remain an unattainable good as long as laws and government and men are imperfect. The taxation impeached in the case now before us was clearly within the limit thus prescribed. It was for a public purpose, and to sub-serve an end eminently advantageous to the community upon which it was levied. It has not been pretended and could not be, that the legislature had not the power antecedent to authorize it. If so, they could cure any irregularity or want of authority in levying it by a retroactive law, even though thereby a right of action which had been vested in an individual should be divested. It is within the principles of all the decisions of admitted authority. If the legislature can cure an irregularity in a judgment or other legal proceedings, or defective deeds, mortgages, or other assurances, by retroactive laws, thereby destroying existing legal claims or defences, or practically transferring legal vested titles, & fortiori may they make valid the acts of public officers in the boná fide performance of public duties, such as that of levying *438and collecting taxes imposed for an admitted public good, and whose justice and equality are not impugned. The familiar maxim applies in such a case: Omnis ratihabitio retrotrahitur et mandato priori cequiparatur.
Nor is there any greater force in the argument which has been strongly urged upon us, that the plaintiff having commenced this action before the passage of the confirming act, had thereby acquired a right to his costs of suit, of which he cannot now be deprived. There is no vested right to costs in any case of which a party cannot be divested by the legislature. All costs, both in England and this state, depend on the statutes. They would fall with their repeal. When a statute giving a special remedy is repealed, pending proceedings die with the repealed statute, unless they are specially saved, and with them necessarily the costs: Commonwealth v. Beatty, 1 Watts 382; Fenlon’s Petition, 7 Barr 174. The limb cannot retain life when the body is dead. When, indeed, a judgment for "costs has been rendered under a repealed statute, it stands, notwithstanding the repeal: Betchol v. Cobaugh, 10 S. & R. 121. Having passed in rem judioatam, it has a new and independent life, which the legislature may sustain by curing its irregularity, but cannot destroy without the exercise of judicial functions, to which it is incompetent and unfitted. In the cases in which the constitutional power of the legislature to modify, enlarge, or repeal existing remedies and to remove legal impediments in the way of recovery, even when pending in a court of error, has been recognised, the right to costs has never been supposed to interpose an obstacle : Adie v. Sherwood, 3 Whart. 481; Lilly v. Underwood, 10 S. & R. 97; Hepburn v. Curts, 7 Watts 300; Schenley v. The Commonwealth, 12 Casey 29.
Judgment affirmed.