The motion in error upon which the record in this cause is brought before us for revision, was filed by the respondent King as a stockholder and an attaching and execution creditor of the other respondent, the New York, Housatonic and Northern Railroad Company; and he is the only party who actually appears here as plaintiff in error and claims to be aggrieved by the decree of the Superior Court, though the respondent company is nominally a party.
Several questions are raised by the assignment of errors, some of which, owing to their importance, deserve careful consideration.
The first question is whether the respondent, the New York, Housatonic and Northern Railroad Company, at the time it executed, delivered and issued the mortgage and bonds described in the bill of the plaintiffs below, had a corporate existence under the laws of this state or of the state of New York. The l-ecord shows that on the 8th day of September, 1863, a corporation was duly organized under the laws of the state of New York, by the name of the New York, Housatonic and Northern Railroad Company, for the purpose of constructing, maintaining and operating a railroad from a point in the New York and Harlem railroad in the town and village of White Plains in that state, to certain points in the' *216boundary line between that state and this, and thence to a point in the Housatonic railroad near Bropkfield station in Fairfield County, and also for the purpose of operating a railroad between the latter point and the points referred to at the state line and in White Plains and the city of New York; that the corporation so organized soon afterwards located and established the line of its road in the state of New York, procured the right of way for the construction thereof, graded from one-lialf to two-thirds of the same, and laid down a temporary track on some parts of the road, over which were run an engine and cars, by the contractors, for the purposes of construction.
On the first day of July, 1864, that corporation obtained from the General Assembly of this state authority to continue and extend its road from the point where it touched the state line, to the Housatonic railroad in the town of Brookfield; to purchase, receive and hold, in fee simple or otherwise, such real estate as might be necessary or convenient for the objects and intentions of the act by which such authority was conferred ; to construct, complete, equip, maintain, use and enjoy, a single, double or triple railway upon the route which should be duly laid out or located; and to take, transport and convey persons and property upon the said railway; and also the further authority to make any lawful contract with any other railroad company with whose road its track might connect, in relation to the business or property of the same, and to take lease of any railroad, or lease its railroad to, or make joint stock with, any connecting railroad running in the same general direction as the route of its road; together with all the powers and privileges which then were, or which thereafter should be, conferred on all railroad companies incorporated under the authority of this state, but subject to all the duties, liabilities and regulations imposed upon such railroad companies.
On the first day of May, 1865, this corporation was authorized by the legislature of New York to accept and exercise the powers conferred by the General Assembly of this state, and subsequently did accept the same and located its railroad *217from the state line to the Housatonic railroad in Brookfield, and obtained title, in fee simple, to lands in Brookfield and Danbury necessary for its road and for depots along its line from the Housatonic railroad to Danbury. It also obtained the right of way for the construction of the residue of its road within this state, and constructed, completed, equipped and put into full operation that part of its road between the Housatonic railroad and the village of Danbury; and that portion of the road has ever since been in full operation.
On the 20th day of May, 1869, an act was passed by the legislature of New York, making it lawful for any railroad company organized under the laws of that state or of that and any other state, and operating a railroad or bridge either wholly within or partly within and partly without that state, to merge and consolidate its capital stock, franchises and property with the capital stock, franchises and property of any other railroad company or companies organized under the laws of New Yoi'k, or under the laws of that and any other state, or under the laws of any other state or states, whenever the two or more roads of the companies so to be consolidated should or might form a continuous line of railroad with each other or by means of any intervening railroad, bridge or ferry. The act prescribed the mode by which the consolidation might be made and perfected, and provided that when the agreement and act of consolidation were so made and perfected, and when the same or a copy thereof was filed in the office of the secretary of the state, the corporations parties thereto should be deemed and taken to be one corporation by the name provided in said agreement and act, but that such act of consolidation should not release such new corporation from any of the restrictions, disabilities or duties of the several corporations so consolidated. And it was further provided that upon the consummation of the act of consolidation, all and singular the rights, privileges, exemptions and franchises of each of the corporations parties to the same, and all the property, real, personal and mixed, and all debts due, on whatever account, to either of said corporations, should be deemed to *218be transferred to, and vested in, such new corporation without further act or deed.
On the 18th day of April, 1872, an agreement was made between the said New York, Housatonic & Northern Railroad Company and the Southern Westchester Railroad Company, a corporation duly organized under the laws of New York, for the consolidation of the capital stocks, franchises and property of the two corporations. The agreement was in the form prescribed by the New York statute and was duly executed, and on the 10th day of September, 1872, was adopted by the stockholders of each of the corporations; and the same was filed in the office of the secretary of the state of New York on the 3d day of October, 1872. Nothing more was required by the laws of New York to perfect the agreement and consummate the act of consolidation, if, by those laws, the corporations, parties to the agreement, had the right to consolidate their capital stocks, property and franchises, and thus become one corporation. The plaintiffs in error claim that no such right existed, because, although the railroads of the two corporations were capable of forming, and would form when completed, a continuous line of railroad from the Housatonic railroad to the Harlem river, neither of the corporations, at the time the agreement of consolidation was made, was operating a railroad or bridge wholly within or partly within and partly without the state of New York. This claim is an extraordinary one for the party to urge who appears here in no other character, and who has no other interest in the event of this suit, than as a stockholder and creditor of the consolidated corporation. But it is conclusively answered and disposed of by an act of the legislature of New York passed in 1873, which expressly recognized the existence of the consolidated corporation, and thereby ratified and confirmed the agreement by which the consolidation was effected. N. York Stat. of 1873, page 293. It is said, however, by counsel for the plaintiffs in error, that that act was a recognition merely of the corporation, and did not operate as a ratification of the agreement of consolidation. And the case of Blade River Railroad Co. v. Barnard, 31 Barb., 258, *219is cited in support of this position. But the court in that case held that, when the organization of a railroad company is regular on its face, and the company, while in the exercise of its corporate franchises, is recognized as such by the legislature, it becomes, by that recognition, a legal corporation. In the case of The People v. Farnham, 35 Ill., 562, it was held that, where a municipal corporation has been recognized by enactments of the General Assembly, all inquiry into the regularity of its organization will be precluded. And in the case of Kanawha Co. v. Kanawha &c. Coal Co., 7 Blatch., 391, it was held that defects in the incorporation of a company under a general mining and manufacturing companies law, were cured by the passage of a subsequent special act recognizing the company by name and extending and continuing its corporate rights and privileges.
So far then as the state of New York is concerned, there can be no doubt that the agreement of consolidation was in all respects valid; and the effect of it was to transfer to and vest in the consolidated corporation all the rights, privilege's, franchises and property of the two original corporations in that state. And if such consolidation was authorized by the laws of Connecticut, the effect of it was to vest in the consolidated company all the rights, privileges, franchises and property of the original New York, Housatonic & Northern Railroad Company in this state. The General Assembly of this state, by an act passed on the 31st day of July, 1872, expressly authorized such consolidation, and declared its effect in the following language:
uResolved by this Assembly: Sec. 1. In case the New York, Housatonic & Northern Railroad Company shall avail itself.of the powers conferred upon certain railroad companies by the laws of the state of New York, authorizing the consolidation of such railroad companies, and shall, in pursuance of such laws, consolidate with any other railroad company, the new corporation formed by such consolidation, shall have and possess, in this state, all the rights, powers, privileges, exemptions, franchises and property now possessed by said New York, Housatonic & Northern Railroad Com*220pany in this state, or which have heretofore been conferred upon it by the General Assembly of this state, and shall be subject to all duties and liabilities, in the same manner and to the same extent as if such consolidation had not taken place.” By the second section of the act the rights of all creditors of the said New York, Housatonic & Northern Railroad Company, and all liens upon its property, were preserved unimpaired, and authority was given to enforce them against the new corporation.
The requirement of the foregoing act that the consolidation shall be in pursuance of the laws of the state of New York, is fully satisfied by -any proceeding in that state by which the consolidation is legally effected, whether by a lawful agreement for such consolidation, or an act of the legislature effecting it, or a recognition by the legislature of the consolidated corporation as in existence.
. The legal existence of the consolidated corporation in this state as well as the state of New York, is thus conclusively established. There is, therefore, no occasion for the application in this case of that principle of law which estops a party who has contracted with another as a corporation from denying the legal existence of the latter as a corporation.
The effect of the consolidation has already been stated. As declared by the New York law, it was to transfer to, and vest in, the consolidated corporation, without further act or deed, all and singular the rights, privileges, exemptions and franchises of each of the corporations parties to the same, and all their property, real, personal and mixed, and all debts due on whatever account to either of those corporations. As declared by the Connecticut law, the effeot of the consolidation was to confer upon and give to the new corporation in this state all the rights, powers, privileges, exemptions, franchises and property possessed, on the 31st day of July, 1872, by the New York, Housatonic & Northern Railroad Company, one of the parties to the agreement of consolidation, in this state, or which had theretofore been conferred upon that corporation by the General Assembly of this state. This disposes of the claim of the plaintiffs in error *221that the consolidation, if valid in New York by the laws thereof, did not and could not transfer to the new company the rights, franchises and property of the old company in this state, and shows that the claim rests upon no legal foundation whatever.
The next question is, whether the mortgage which is the subject of this litigation is a valid security for the payment of the bonds which it was executed to secure. This depends, of course, upon the laws of New York and of this state under which the instrument was professedly executed. By the laws of New York each of the corporations which formed the consolidated company was empowered, from time to time, to borrow such sums of money as might be necessary for completing and finishing or operating its railroad, and to issue and dispose of its bonds for any amount so borrowed, and to mortgage its corporate property and franchises to secure the payment of any debt contracted by the company for the purposes aforesaid. And by an act of the General Assembly of this state passed July 12th, 1867, it was provided that in any mortgage of its property and franchises in the state of New York which the New York, Housatonic & Northern Railroad Company might make in conformity with the laws of that state, the said corporation might embrace and include any property, rights and franchises which it might possess in this state, and that any such mortgage should be deemed and held a good and valid mortgage, for the purposes therein expressed, of said property, rights and franchises of said corporation in this state, and should have the same operation and effect upon said property, rights and franchises of said corporation in this state as if said property, rights and franchises in this state were held and owned by said corporation in the state of New York and were so mortgaged in that state pursuant to the laws thereof by said corporation.
That these laws gave to the original New York, Housatonic & Northern Railroad Company full power and authority to mortgage its property and franchises in this state as well as in the state of New York, to secure the payment of such sum or sums of money borrowed as might be necessary for com*222pleting and finishing or operating its railroad, counsel for the plaintiffs in error admit. But they deny that the consolidated company had any such power. It has, however, been shown that the effect of the consolidation was to confer upon, and give to, the consolidated company in this state, all the rights, powers, privileges, exemptions, franchises and property possessed by the original New York, Housatonic & Northern Railroad Company in this state on the 31st day of July, 1872; and this, of course, included the power of borrowing money and mortgaging the property and franchises of the corporation in this state to secure its payment. The mortgage was, •therefore, a valid security for the purposes for which it was executed, and operated as a lien upon the franchises as well as upon the real and personal property which became vested in the consolidated corporation by the agreement and act of consolidation.
But it is said by the plaintiffs in error that it is not averred in the bill of the plaintiffs below, and was not proved at the hearing, that the bonds mentioned in the condition of the mortgage were used for a lawful purpose. The bill however alleges that the respondent corporation, the mortgagors, did duly make, issue, sell, dispose of and deliver to divers persons a large number of said bonds, and that by such sale and delivery many persons who received the said bonds became, were and still are the bond fide holders and owners thereof and entitled to receive the moneys by said bonds agreed to be paid respectively, according to the tenor of said bonds, and entitled also to the benefit of said mortgage. And it is found by the court that all of the bonds provided for in the mortgage were duly executed, issued and delivered in different amounts to different persons for valuable considerations received by said corporation therefor — a portion of said bonds, amounting to about 1600,000, being issued and used in exchange for, and for the taking up of, the same amount of bonds then outstanding, which had been issued under and secured by a mortgage of the original New York, Housatonic & Northern Railroad Company. And it is further found by the court that all the allegations of the said bill, except so *223far as any of them are inconsistent with the facts found to be true, are true. These allegations and findings, considered in connection with the recitals in the mortgage deed, are sufficient to establish the claim of the defendants in error that the bonds were lawfully issued and used, and that the parties to whom they were issued and delivered, and in whose hands they were at the time of the commencement of the suit in the court below, were bond fide holders of them for value, and as such are entitled to the benefit of the security which the mortgage was designed to afford.
It is further claimed by the plaintiffs in error that the Superior Court had no jurisdiction of the subject matter of the bill upon which the decree complained of was passed, because by the act of the General Assembly of 1867 this state transferred its jurisdiction to the courts of the state of New York. But this claim cannot be sustained. The courts of New York might, perhaps, have taken jurisdiction of a bill brought by the petitioners for the foreclosure of the mortgaged premises and passed a decree which would have been operative upon that portion of the premises which is situated in this state as well as that portion which is situated in the state of New York. In Toller v. Carteret, 2 Vern., 495, where a bill was filed by the mortgagee for the foreclosure of the Island of Sark, the defendant pleaded to the jurisdiction of the court, that the Island of Sark was part of the Duchy of Normandy and had laws of its own, and was not under the jurisdiction of the English Court of Chancery. But the Lord Keeper overruled the plea, observing that the Court of Chancery had jurisdiction, “the defendant being served with process here.” And it is a principle firmly established that equity, as it acts primarily in personam and not merely in rem, may, where a person against whom relief is sought is within the jurisdiction, make a decree, upon the ground of a contract or an equity subsisting between the parties, respecting property situated out of the jurisdiction. Penn v. Lord Baltimore, 1 Ves., 444. But the circumstance that the courts of New York may have jurisdiction does not necessarily oust or deprive the courts of this state of jurisdiction over the *224same subject matter, and especially where the latter courts are applied to for relief before the jurisdiction of the courts of New York has attached. The courts of this state have jurisdiction of all cases affecting property located in this state, and of all suits for the foreclosure of mortgages of such property, unless the jurisdiction has been surrendered to other tribunals by the General Assembly. There is no act to be found among our statutes, (except, perhaps, acts ceding certain lands to the United States for federal purposes,) which can be construed as having such an effect. And it is very doubtful whether the General Assembly possess the constitutional authority to pass such an act.
The only remaining question which deserves serious consideration is, whether the plaintiff in error, King, by the levy of his execution upon the mortgaged premises, and setting off the same before the mortgage in the present suit was recorded in the towns of Danbury and Brookfield, obtained a priority of title over the unrecorded mortgage. King had actual knowledge and notice of the mortgage, and of the execution, issue and delivery of the bonds the payment of which it was made to secure, at the time of such execution, issue and delivery; and he knew at the time he attached the mortgaged premises in the suit in which he obtained the judgment and execution by virtue of which the premises were set off to him, that the mortgage and bonds were outstanding and unsatisfied. That suit was founded upon' certain judgments which had been assigned to him, and in some of those judgments Rucker, the president of the respondent company, who executed the mortgage, had an interest, and to the extent of that interest the shit was brought by King as the agent of Rucker. Rucker of course had knowledge of the mortgage and of the bonds at the time they were executed, issued and delivered. The debts out of which the judgments arose were contracted afterwards: Had King or Rucker under such circumstances and with such knowledge purchased the mortgaged premises and taken a deed of them or had taken a mortgage of the premises to secure the payment of their debts, it is perfectly clear, and indeed is conceded by the *225counsel for the plaintiffs in error, that the mortgage upon which the present suit is founded, though unrecorded, would have been entitled to priority over the title acquired by their deed. No doctrine is better established than that the person who purchases an estate, though for a valuable consideration, after notice of a prior equitable right, makes himself a maid fide purchaser, and will not be permitted, by getting in the legal estate, to defeat such prior equitable interest, but will be held to be a trustee for the benefit of the party whose right he has sought to defeat. Le Neve v. Le Neve, Amb., 436; 3 Atk., 646. But it is insisted by the plaintiffs in error that this doctrine, founded as it is upon the presumed fraud of the party becoming a purchaser under such circumstances, does not apply to attaching or execution creditors. The same claim was made in the case of Carter v. Champion, 8 Conn., 549, but it was left undecided. The court however held in that case that notice of an unrecorded deed, given to an attaching creditor of the grantor after his attachment and before the levy of his execution, could have no effect; for the creditor who had acquired a lien by his attachment could not be deprived of the effect of it by a subsequent act of another person. But it has been long settled in Massachusetts that a creditor who, with notice of a previous unregistered conveyance executed for a valuable consideration, attaches or levies upon the estate conveyed as the property of the grantor, conducts himself fraudulently, and therefore acquires by his attachment and levy no title against the grantee. Prescott v. Heard, 10 Mass., 60; Priest v. Rice, 1 Pick., 164; Coffin v. Ray, 1 Met., 212; Curtis v. Mundy, 3 Met., 405; Pomeroy v. Stevens, 11 Met., 244; Lawrence v. Stratton, 6 Cush., 167, 169; Sibley v. Leffingwell, 8 Allen, 584. And the same doctrine has been recognized by the courts of other states. Daniels v. Sorrells, 9 Ala., 436; Dixon v. Lacoste, 1 Sm. & Marsh., 70; Taylor v. Echford, 11 id., 21; Walker v. Gilbert, Freem. (Miss.) 85; Morton v. Robards, 4 Dana, 258. There are some authorities, however, which favor the doctrine contended for by counsel for the plaintiffs in error. But no doubt can be justly entertained that where, as in this case, *226a party witb notice of an unregistered conveyance, absolute or by way of mortgage, gives credit to the grantor or mortgagor, and subsequently attaches or levies an execution upon the entire estate to secure the payment of the debt thus created, he does an act against good conscience and in abusé of the statute, which was made to prevent, not to protect fraud, and therefore will not be allowed to acquire by his attachment or levy, or both, a priority of title over the unregistered conveyance. In giving credit to the grantor or mortgagor, under such circumstances, the creditor does not rely upon the property embraced in the conveyance for the payment of his debt. He is not deceived or misled by the absence of the conveyance from the records, because he has all the notice which the records are designed to afford; and he suffers no wrong or injury from the application of the rule which puts him in the predicament of a subsequent purchaser with notice of a prior unregistered deed.
There is, therefore, no error in the decree of the Superior Court, and it is affirmed.
In this opinion the other judges concurred.