Affirming.
The appellant, Mrs. Annie Hamner Meacham, sued appellee, Louisville Nashville Railroad Company, for $10,000 damages alleged to have been done her farm when the company removed its tracks and a switch from lands her predecessors in title had conveyed the grantee as a right-of-way. The answer denied the damages and affirmatively averred in a second paragraph that it was a common carrier engaged in interstate commerce and that the Interstate Commerce Commission ordered it to abandon this particular part of its line, which was a branch between Clay, Kentucky, and Morganfield, Kentucky. By a third paragraph the company offered to *Page 644 quitclaim the right-of-way to the plaintiff. The court overruled a demurrer to the second paragraph of the answer, plaintiff declined to plead further, and her petition was dismissed.
In 1905 plaintiff's parents and predecessors in title, W.E. Hamner and wife, conveyed by a general warranty deed to the Morganfield Atlanta Railroad Company, hereinafter referred to as the M. A., an 80 foot right-of-way through their farm. The deed recited the consideration for the right-of-way, which consisted of 7.66 acres, was the agreement by the M. A. to erect and forever (our italics) maintain at some point on the promises a switch to be called Hamner, which would be a flag station where the grantors, their heirs and assigns, could load and unload freight. The grantee also was to maintain a fence on both sides of the right-of-way, and agreed to dismiss and pay all costs of a condemnation proceeding it had instituted.
The M. A. operated its trains over this track until 1921, when the Louisville Nashville Railroad Company purchased the line. In 1939 the latter company obtained an order from the Interstate Commerce Commission under paragraphs 18 and 19, Section 1, of the Interstate Commerce Act, 49 U.S.C.A. Section 1 (18, 19), authorizing it to abandon that portion of its branch line extending from Clay, Kentucky, to Morganfield, Kentucky, as public convenience and necessity no longer required its operation. After due notice this branch line was abandoned, the track and switch removed, and in 1940 Mrs. Meacham instituted this action.
It is insisted by plaintiff that under the deed conveying the right-of-way to the M. A., that railroad and its successors were obligated to erect and maintain forever this switch; that the L. N., as successor in title to the M. A., was not forced to abandon this line but voluntarily sought and obtained permission to do so from the Interstate Commerce Commission. She avers her farm was damaged by being deprived of the switch and by the unsightliness of the right-of-way with the rails removed running through her elegant farm. The defendant contends that the Interstate Commerce Commission had not only the authority but the duty to direct the abandonment of this branch line when the public convenience and necessity no longer required its operation, and that a proper construction of the deed relieves *Page 645 it from liability to maintain this switch and flag station after the Commission ordered the line abandoned.
A fundamental rule in the construction of contracts is to determine the intention of the parties from the contract as a whole and to give it such an interpretation as will carry out that intention, and in so doing, the court may consider the subject matter of the contract, the object to be accomplished, the situation of the parties and their surrounding conditions and circumstances. 17 C.J.S., Contracts, 707, Section 297; Hawkins Chamberlain v. Matthews, 242 Ky. 732,47 S.W.2d 547; Monroe's Adm'r v. Federal Union Life Ins. Co., 251 Ky. 570, 65 S.W.2d 680; Keen v. Ross, 186 Ky. 256,216 S.W. 605; Warfield Natural Gas Co. v. Moore, 281 Ky. 689,136 S.W.2d 1086.
Applying this rule to the right-of-way deed it is clear that it was the intention of the parties the grantee would operate a railroad and would maintain this switch and flag station so long as the line, of which it was a part, existed. But plaintiff urges the parties were free to contract as they saw fit and as they agreed the switch should be maintainedforever the railroad could not cease to operate this line; or if it did, then it must respond in damages. The answer to this argument is that while a railroad is a private corporation, yet it is a quasi public agency, and one contracting with it must have contemplated the fact that when public necessity and convenience required the abandonment of a particular part of its line, it would not be bound by a contract to operate that line in perpetuity. Louisville N. R. Co. v. Johnson's Adm'x,207 Ky. 813, 270 S.W. 58; Eckington etc., R. Co. v. McDevitt,191 U.S. 103, 24 S.Ct. 36, 48 L. Ed. 112; Scheller v. Tacoma Ry. Power Co., 108 Wn. 348, 184 P. 344, 7 A.L.R. 810; Texas P. R. Co. v. City of Marshall, 136 U.S. 393,10 S.Ct. 846, 34 L.Ed. 385; Jones v. Newport News M. V. Co., 6 Cir.,65 F. 736, 13 C.C.A. 95; Texas P. R. Co. v. Scott, 5 Cir.,77 F. 726, 23 C.C.A. 424, 37 L.R.A. 94, 41 U.S. App. 624.
In answer to plaintiff's argument that the abandonment of this line was voluntary by the railroad, we call attention to Transit Commission v. United States, 289 U.S. 121,53 S.Ct. 536, 538, 77 L.Ed. 1075, where it was said the Commission has "plenary power to limit interstate carriers' expenditures for construction or operation *Page 646 to lines of railroad reasonably necessary for the service of the public." It was written in State of Georgia v. United States, D.C., 28 F. Supp. 749, that the Transportation Act of 1920 introduced a new federal railroad policy seeking to insure adequate transportation service and a primary intention of that policy is to avoid waste. Congress has authorized the Commission to find the facts and to determine whether or not an abandonment is consistent with public convenience and necessity. Colorado v. United States, 271 U.S. 153,46 S.Ct. 452, 70 L.Ed. 878; Railroad Commission of State of Texas v. Eastern Texas R. Co., 264 U.S. 79, 59 S.Ct. 247,68 L.Ed. 569. Therefore, it cannot be said with accuracy that the railroad voluntarily abandoned this line. The abandonment was ordered by the Interstate Commerce Commission.
Appellant admits that contracts are subject to the law of the sovereign and that contractual obligations cannot be extended to defeat legitimate governmental authority, 17 C.J.S., Contracts, 356, Section 24; Legal Tender Cases, 12 Wall. 457, 550, 20 L.Ed. 287, 311; Philadelphia B. W. R. Co. v. Schubert, 224 U.S. 603, 32 S.Ct. 589, 56 L.Ed. 911, but insists that under such authorities as Louisville N. R. Co. v. Crowe, 156 Ky. 27, 160 S.W. 759, 49 L.R.A., N.S., 848; Louisville N. R. Co. v. Johnson's Adm'x, 207 Ky. 813,270 S.W. 58; Louisville N. R. Co. v. Mottley, 219 U.S. 467,31 S. Ct. 265, 55 L.Ed. 297, 34 L.R.A., N.S., 671; Ortega Co. v. Triay, 260 U.S. 103, 43 S.Ct. 44, 67 L.Ed. 153; Texas P. R. Co. v. City of Marshall, 136 U.S. 393, 10 S.Ct. 846,34 L.Ed. 385, the railroad company should compensate her for the loss of the switch. An examination of these authorities shows they are clearly distinguishable from the instant case. In each of them the railroad company retained the benefit received under the contract after the law of the sovereign had excused, or prevented, it from performing the obligation imposed by the contract. In the case at bar when the Commission permitted the L. N. to abandon this line and switch, the railroad returned, or expressed a willingness to return, the right-of-way to the plaintiff.
We agree with the trial judge that it was the intention of the parties in the right-of-way deed that the railroad would maintain this switch during the time it operated this line, and when the Interstate Commerce *Page 647 Commission ordered it to abandon the line, there was no longer any obligation upon the railroad to maintain the switch. Therefore, the second paragraph of the answer that defendant had abandoned this line and switch under an order of the Commission pleaded a good defense to the petition and the court correctly overruled the demurrer thereto.
The judgment is affirmed.