Opinion of the Court by
William Rogers Clay, Commissioner —Reversing.
Covington Bros. & Company conduct a wholesale grocery on the northeast corner of Third and Jefferson streets in Paducah. Immediately across Third street and on the northwest comer of Third and Jefferson streets is the wholesale grocery of the Coleman-Clark Grocery Company. Some time ago, the Chicago, St. Louis & New Orleans Railroad Company, which is con*737trolled by the Illinois Central Railroad Company, ‘constructed into the property of the Covington Bros. & Company a switch or spur track, which is used for receiving and shipping freight. Thereafter, the city of Paducah granted to the Chicago, St.‘-.Louis & New Orleans Railroad Company the right to extend the spur track across Third street, so as to connect with the property of the Coleman-Clark Grocery Company. ; ,, , / ’ '
On September 22, 1914, the Coleman-Clark Grocery Company brought suit against the Chicago, St. Louis & New Orleans Railroad Company to enjoin the construction and operation of the spur track across Third street into the property of the Coleman-Clark Grocery Company. In support of its petition and claim of ownership of the right of way and spur track, Covington Bros. & Company filed two deeds, one from Covington Bros. & Company to the Chicago, St. Louis & New Orleans Railroad Company, and one from S. B. Caldwell to the Paducah City Railway Company and Covington Bros. & Company. A demurrer was sustained to the petition, and plaintiff having declined to amend, the petition was dismissed. Thereupon, plaintiff prayed an appeal to the Court of Appeals, which was granted. The appeal was abandoned and the judgment was never modified, set aside or reversed.
On August 23, 1915, this suit was brought by Covington Bros. & Company against the Chicago, St. Louis & New Orleans Railroad Company and others, to enjoin the defendants from constructing the extension across Third street, to quiet its title to the right of way and to have the franchise granted by the city of Paducah declared void. The defendants pleaded the first judgment in bar of plaintiff’s right to relief, but this plea was held insufficient. Thereafter, the case was submitted on the evidence, pleadings and exhibits, and plaintiff was granted the relief prayed for. The defendants appeal.
In deciding whether a judgment on a demurrer is a bar to a subsequent action it is necessary to consider what was determined by the judgment. If the demurrer be sustained because the facts were defectively pleaded or some essential allegation was omitted, the judgment on the demurrer is not a bar to a subsequent action on a petition which supplies the defects which were fatal to the petition in the first action; but if the facts, are well pleaded in the first petition, the judgment on the de*738murrer is in effect a decision upon the merits of those facts, and is a bar to another suit upon substantially the same facts. West v. King, 163 Ky. 561, 174 S. W. 11; Randolph’s Admr. v. Snyder, 139 Ky. 159, 129 S. W. 562; Thomas v. Bland, 91 Ky. 1, 14 S. W. 955; Cassidy v. Young, 92 Ky. 227, 17 S. W. 485.
The petition in the first action alleges.in substance that plaintiff was the owner of the lot on which its office and warehouse and the spur track were located; that the right of way was secured by plaintiff, and defendant was permitted to construct the spur track with the under' standing that the right of way and spur track were for the personal use of plaintiff and no one else, and that the defendant was threatening to extend the spur track across the street -to the property of the Coleman-Clark Grocery Company, for the exclusive use of said company; that the extension would not benefit the public; that it would interfere with the use of the streets by the public; that at times it would completely obstruct plaintiff’s ingress and egress, and would result in great and irreparable injury to plaintiff; that he had no adequate remedy at law; that the injunction asked for had not been asked of or refused by the court or by any circuit judge, etc.
. These allegations are substantially the same as those contained in the petition in this action, the only difference being that the facts stated are set forth with greater detail and the deeds, which are merely evidential, are referred to in the petition. Manifestly, if plaintiff was the owner of the lot on which the spur track was constructed and was entitled to the exclusive use of the spur track, the railroad company could not extend the spur track for the use and benefit of others without violating plain- ' tiff’s rights in the premises, and in our opinion the facts alleged in the first petition are sufficient to show that plaintiff was the owner of the lot and entitled to the exclusive use of the spur track. That being true, the facts were well pleaded, and the judgment sustaining the demurrer and dismissing the petition in the first action is a bar to the present action, which is based upon sub- \ stantially the same facts.
It follows that the plea of res judicata .should have been -sustained, and the petition dismissed.
Judgment reversed and cause remanded for proceedings consistent with this opinion.