On the 31st day of December, 1898, the plaintiff and his wife, Lucy A. Cowley, now deceased, were the owners of a tract of land in the city of Spokane, and on that date they entered into a written contract with the defendant whereby they agreed to convey the property to it by a deed of quitclaim. As a consideration for the conveyance of the property, the defendant agreed to issue and deliver annual passes to the plaintiff and his wife, for and during the natural life of each thereof, entitling them to free transportation over the defendant’s entire system of railway and steamship lines, and to issue like passes to their five children for a period of five years from the date of the contract. In pursuance of the contract, the plaintiff, on October 20, 1899, conveyed the property to the defendant. The defendant performed its agreement with Lucy A. Cowley until her death, which occurred on the 28th day of November, 1900, and performed its agreement with the children during the five years stipulated in the contract, and performed its agreement with the plaintiff until the taking effect of the act of Congress of date June 29, 1906, known as the Commerce Act (chapter 3591, U. S. Compiled Statutes, Supp. 1909, pages 1149 to 1153). Section 6 of the act is as follows:
“No carrier, unless otherwise provided by this act, shall engage or participate in the transportation of passengers or property, as defined in this act, unless the rates, fares and charges upon which the same are transported by said carrier have been filed and published in accordance with the provisions of this act; nor shall any carrier charge or demand or collect or receive a greater or less or different compensation for such transportation of passengers or property, or for any service in connection therewith, between the points named in such tariffs, than the rates, fares, and charges which are specified in the tariff filed and in effect at that time, nor shall any carrier refund or remit, in any manner, or by any device, any portion of the rates, fares, and charges so specified, nor *560extend to any shipper or person any privileges or facilities in the transportation of passengers or property except such as are specified in such tariffs.”
The plaintiff’s children have conveyed to him whatever rights they may have in the property. After the taking effect of the act, the defendant refused to further perform its contract, upon the ground that it could not legally do so. The plaintiff has sued for a rescission of the contract, and for a reconveyance of the property. He offered in his complaint to repay to the defendant the value of all the transportation issued in conformity to the contract. The court denied a rescission and reconveyance, and entered a judgment against the defendant for the sum of $1,500, the amount which the court found the plaintiff will be obliged to expend in railway fare to take the trips which he would have taken had the agreed transportation been furnished him. Both parties have appealed, and they will be referred to as plaintiff and defendant.
The following is an epitome of the facts The plaintiff, at the time of the trial, had been a resident of Long Beach, in the state of California, for about eight years, and was then seventy-three years of age and had a life expectancy of approximately seven years. The court found that the market value of the property when conveyed to the defendant was about $15,000, and that its value at the time the action was commenced was $200,000.
The act of Congress to which reference has been made forbade the further performance of the contract by the defendant. Louisville N. R. Co. v. Mottley, 219 U. S. 467. That was an action to require the railway company to specifically execute a contract which it had made with the Mottleys, to issue to them free passes over its roads annually during their lives in settlement of a claim which they were asserting against it for personal injuries sustained by them as the result of a collision between trains belonging to the *561railroad company. In commenting upon the question of the enforcibility of the contract, the court, at page 482, said:
“The agreement between the railroad company and the Mottleys must necessarily be regarded as having been made subject to the possibility that, at some future time, Congress might so exert its whole constitutional power in regulating interstate commerce as to render that agreement unenforcible or to impair its value. That the exercise of such power may be hampered or restricted to any extent by contracts previously made between individuals or corporations, is inconceivable. The framers of the constitution never intended any such state of things to exist.”
And at page 483, it said:
“After the commerce act came into effect, no contract that was inconsistent with the regulations established by the act of Congress could be enforced in any court.”
And again, at page 485, it said:
“We forbear any further citation of authorities. They are numerous and are all one way. They support the view that, as the contract in question would have been illegal if made after the passage of the commerce act, it cannot now be enforced against the railroad company, even though valid when made.”
The defendant, in support of his contention that he is entitled to rescind and to have the property restored to him, among other cases, cites the following: Thomas v. McCue, 19 Wash. 287, 53 Pac. 161; Cochran v. Yoho, 34 Wash. 238, 75 Pac. 815; Garvey v. Garvey, 52 Wash. 516, 101 Pac. 45; Lambert v. Lambert, 66 W. Va. 520, 66 S. E. 689; Willard v. Ford, 16 Neb. 543, 20 N. W. 859; Chapman v. County of Douglas, 107 U. S. 348; Payette v. Ferrier, 20 Wash. 479, 55 Pac. 629; 24 Am. & Eng. Ency. Law (2d ed.), 641.
In the Thomas case, the court, in discussing the doctrine of rescission, said:
“Rescission is a remedy which is not to be invoked as a matter of course or of absolute right, but, like specific performance, its exercise rests in the sound discretion of the *562court. 2 Warvelle, Vendors, p. 833. . . . Before a party can justly claim a rescission lie must not only show that the opposite party is derelict, but that he himself is without fault, . . .”
In the Cochran case, it is said:
“ ‘Where one of the parties to a contract, either before the time for performance or in the course of performance, makes performance or further performance by him impossible, the other party is discharged and may sue at once for the breach.’ 9 Cyc. 639, and authorities cited.”
The Garvey and Payette cases were actions by a parent against a child to have property reconveyed where the consideration for the conveyance was the support of the grantor, and the grantee had failed or refused to perform. In the Lambert case, the grantor had conveyed certain property to the grantee upon a promise of marriage which the grantee had broken by marriage with another. The rule announced in 24 Am. & Eng. Ency. Law (2d ed.), 641, is that, “in granting cancellation of an instrument, the court proceeds whcilly upon equitable principles.” In the Willard case, it is said that “the rescission, cancellation and delivering up of agreements, deeds, etc., is the converse of a specific performance.” In the Chapman case, in considering the question as to when the illegality of a contract will excuse performance, the court said that, “the illegality in the contract related not to its substance, but only to a specific mode of performance.” And further that: “The illegality is not that which arises where the contract is in violation of public policy or of sound morals, but under which the law will give no aid to either party.” Without further reference to authority, it suffices to say that the performance of the contract was not arrested by the act or omission of the defendant, but by the enactment of a law which made further performance of the contract illegal. The case falls within the exception stated in the Chapman case. In the cases cited by the plaintiff, there was an equitable right in the plaintiff and a delict upon the part *563of the defendant. In other words, the defendant had agreed to do some act which he either could not or would not do, the doing of which would violate no law or rule of public policy. In view of the intervening law, the substantial performance of the contract by the defendant, and the marked increase in the value of the property, a court of equity cannot, in consonance with equitable principles, direct a restitution of the property.
The next question presented is, Did the court err in entering a judgment against the defendant for damages? Drake v. Whalley, 35 S. C. 187, 14 S. E. 397, thus defines a cause of action:
“A ‘cause of action’ has been held, in brief, to be a legal right of the plaintiff invaded by the defendant, and it arises when the invasion takes place.”
In Kennerty v. Etiwan Phosphate Co., 21 S. C. 226, 53 Am. Rep. 669, it is said that:
“A cause of action, defined in a few words, is a primary right of one, either legal or equitable, invaded by another.”
Stated in other words, a cause of action must show a legal or equitable right in one party and a wrong in the other party touching the subject-matter of the action. If these elements do not coexist, a cause of action does not arise. In Pomeroy on Contracts (2d ed.), § 280, the rule respecting illegal contracts is stated as follows:
“An illegal contract is, as a rule, void — not merely voidable — and can be the basis of no judicial proceeding. No action can be maintained upon it, either at law or in equity. This impossibility of enforcement exists, whether the agreement is illegal in its inception, or whether, being valid when made, the illegality has been created by a subsequent statute.”
Brown v. Mayor etc. of London, 9 Com. Bench Rep. (N. S.) 725, was a suit upon a contract, with a condition the performance of which was rendered impossible by an act of Parliament. Speaking to the question of a discharge of a contract by such a law, Williams, J., said:
*564“The instrument upon which this action is brought is not an absolute contract on the part of the defendants to pay the several sums mentioned in the bonds. But it is a contract with a condition. Now, the law as to such contracts is clear. If the condition has been performed, the obligation is discharged ; and it is equally discharged, if, instead of the condition having been performed, its performance has been prevented by the act of God or the act of the law.”
In Bullard v. Northern Pac. R. Co., 10 Mont. 168, 25 Pac. 120, 11 L. R. A. 246, it was held that rebates upon shipments, under a contract fixing the price of carriage and providing for a rebate equal to the difference between the contract price and the regular schedule of freight rates upon like articles, could not be recovered after the enactment of the commerce law of February 4, 1887. In this connection the court said:
“There is an old rule of law which can be invoked and applied to the case at bar. In Atkinson v. Ritchie, 10 East 530, Lord Ellenborough, Ch. J., said, in the opinion: ‘That no contract can properly be carried into effect which was originally made contrary to the provisions of law, or which, being made consistently with the rules of law at the time, has become illegal in virtue of some subsequent law, are propositions which admit of no doubt.’ ”
American Mercantile Exchange v. Blunt, 102 Me. 128, 66 Atl. 212, 120 Am. St. 468, 10 L. R. A. (N. S.) 414, is an instructive case, and announces the same view. See, also, the footnote to this case. In Doe on Demise of Marquis of Anglesea v. Churchwardens of Rugeley, 6 A. & E. N. S. Q. B. 107, in speaking of the nonperformance of a condition in a lease because forbidden by law, it is said by Lord Den-man, C. J.:
“But, even if the condition were not performed, it appears to us that the nonperformance would in this case be excused, as being by act of law, and involuntary on the part of the lessees.”
In Fitzgerald v. Grand Trunk R. Co., 68 Vt. 169, 22 Atl. *56576, 13 L. R. A. 70, in defining the words, “obligation of a contract,” it is said:
“The obligation of a contract in law is that element of duty or promise which a party can be compelled to perform. If performance cannot be compelled, there is no legal obligation in the contract.”
These observations apply with equal force to both questions, viz., the right of the plaintiff to a rescission and a reconveyance, and his right to damages. The plaintiff conveyed the property to the defendant upon the faith of defendant’s .promise to perform conditions which were then wholly lawful but which, after a substantial part performance, became unlawful without any contributing cause upon the part of either party. The full performance has not been arrested by any act or omission of the defendant, but by the Congress of the United States acting within its constitutional powers. It follows from what has been said, that the defendant cannot be mulcted in damages because of, and only because of, its observance of a law making further performance of the contract on its part impossible.
The plaintiff’s contention, that the judgment for damages was entered upon the invitation of the defendant, cannot be upheld. The contention is based upon the remarks of the defendant’s counsel at the conclusion of the trial, wherein he said: “I will say now that we will consent that the court reach a just measure of damages.” In the certificate to the supplemental statement containing the quoted words, the court states that, “I will add that my decision was not influenced by any suggestion made by Mr. Cannon as to the attitude we take upon the merits of the controversy.” Were it not for this statement in the certificate, we would be inclined to treat the judgment as having been entered by the court upon the invitation of counsel for the defendant. Moreover, the plaintiff was not content to accept the judgment. Had he done so and had the defendant only appealed, we *566would be more inclined to treat the remarks of the defendant’s counsel as an authorization for the judgment.
The judgment is reversed with directions to dismiss the action.
Mount, Paekee, and Fulleeton, JJ., concur.