
310 U.S. 132 (1940)
WARREN ET AL., TRUSTEES,
v.
PALMER ET AL., TRUSTEES.
No. 643.
Supreme Court of United States.
Argued March 29, April 1, 1940.
Decided April 29, 1940.
CERTIORARI TO THE CIRCUIT COURT OF APPEALS FOR THE SECOND CIRCUIT.
*133 Mr. Erwin N. Griswold, with whom Messrs. John Noble, Jr., and Paul E. Troy were on the brief, for petitioners.
Mr. Hermon J. Wells for respondents.
*135 MR. JUSTICE REED delivered the opinion of the Court.
The Boston and Providence Railroad Corporation in 1888 leased its property, a line of road running between Boston and Providence, for 99 years to the Old Colony Railroad. It has continued as a separate corporation, receiving and distributing its rent, and is not a subsidiary or affiliate of the New Haven or the Old Colony. In 1899 the Old Colony leased its lines, including its leasehold in the Boston and Providence, to the New York, New Haven and Hartford Railroad for 99 years. The New Haven operated its own and the leased property until it was put into reorganization under § 77 of the Bankruptcy Act[1] in the District Court of Connecticut on October 23, 1935. The trustees of the New Haven operated the Old Colony under the lease until they rejected the lease by order of the court on June 2, 1936. Next day the Old Colony filed under § 77 in the same Connecticut court as a subsidiary debtor, the court appointed the trustees of the New Haven trustees of the Old Colony, and on June 18, 1936, the court ordered the New Haven trustees to continue to operate the Old Colony as an integral part of the New Haven, the operation being for the account of the Old Colony. The order provided that, in the event leases of the Old Colony were later rejected, payments for operating the leased property and payments of rent under the lease would be deemed to have been for the account of the lessor and could be recovered from the *136 leased property prior to any mortgage or lien thereon. On July 19, 1938, the court directed the trustees of the Old Colony to reject the lease of the Boston and Providence and to continue operation of the road for the account of the Boston and Providence pursuant to § 77 (c) (6). On August 4, 1938, the Boston and Providence was put into reorganization in the District Court of Massachusetts. Previously the system had been operating at a loss and the trustees of the New Haven and the Old Colony asked the Connecticut court to determine the amount of the deficit attributable to the Boston and Providence for the period from June 4, 1936, to December 31, 1937, and to declare that amount a lien on the Boston and Providence in favor of the New Haven and the Old Colony. On January 16, 1939, the Connecticut court decided that it had jurisdiction to grant the requested lien on the Boston and Providence, although that road was under reorganization in another bankruptcy court, and on April 20, 1939, the court entered an order fixing the amount of the deficit and declaring it a first lien on the property of the Boston and Providence. The Circuit Court of Appeals, holding that the Connecticut court had jurisdiction to determine the lien, affirmed the order of January 16, 1939, but concluded that the Boston and Providence had been given no chance to be heard on the merits of the question and remanded the later order for a determination of the "existence and amount of the obligation."[2]
The obligation on which the claimed lien is based arises, so the trustees of the New Haven and the Old Colony contend, from the operation of the Boston and Providence under § 77 (c) (6) by the Old Colony for the account of the Boston and Providence. Petitioners deny that 77 (c) (6) was properly invoked and claim that the deficit is not chargeable to them. This phase of the controversy *137 is not before us, for petitioners have brought here only the question of the Connecticut court's jurisdiction to determine the amount of the deficit chargeable to the Boston and Providence and to impose a lien on its property to secure it. If the Connecticut court has that jurisdiction, it will determine whether the deficit is chargeable to the Boston and Providence when it determines the "existence and extent of the obligation" pursuant to the order of remand of the Court of Appeals.
The controversy has substance because of the contention of the trustees for the Boston and Providence that, as the court charged with the reorganization of that road (the Massachusetts District Court) has "exclusive jurisdiction" under § 77 (a) "of the debtor and its property wherever located," the Connecticut court cannot consider the claims of the New Haven and Old Colony trustees for operating deficits or impose a lien on the Boston and Providence property to secure them.
The lease of the Boston and Providence to the Old Colony is the type of lease covered by the order of June 18, 1936, by which the trustees of Old Colony were authorized to charge operating deficits against the lessor in the event of subsequent disaffirmance of the lease.
Railroad reorganization in bankruptcy is a field completely within the ambit of the bankruptcy powers of Congress.[3] Under the commerce clause of the Constitution Congress likewise has exercised its power to provide for the continued operation of interstate railroads such as petitioner.[4] The fact that the operator operates under a *138 lease does not affect the force of the requirement that the operation must continue until a certificate permitting abandonment is issued by the Interstate Commerce Commission.[5] The judicial functions of the bankruptcy court and the administrative functions of the Commission work cooperatively in reorganizations.[6] Provision is made by the Bankruptcy Act[7] for the operation of leased property on surrender. It is under this subsection that respondent claims to have become entitled to the amount sought in the motion for allowance and lien. This subsection modifies pro tanto the rule of the Interstate Commerce Act for operation.
The property of the Boston and Providence came into the possession of the trustees of the New Haven and the Old Colony and remained there during the entire time covered by the claim. These roads were lessees of the property and debtors under § 77 in the Connecticut court. It is immaterial what title the debtors had, whether a lease or a fee. The physical property covered by the lease *139 was in the custody of the Connecticut court by virtue of the provision of § 77 (a).[8] By virtue of subdivisions 77 (c) (10) and 77 (c) (6)[9] it is clear that leaseholds are in some instances to be operated by the lessee's trustees.
This Court has held "upon principles of general application" that courts having custody of property or a fund have the power "to require that expenses which have contributed either to the preservation or creation of the fund in its custody shall be paid before a general disposition among those entitled to receive it."[10] Such a power reposes in any court charged with custody of property. It is an in rem jurisdiction springing from possession of the property which is necessary in order that the court may adequately care for the property. Thus a court having custody of a ship is able to secure wharfage by virtue of its power to decree a preferential payment.[11] And here the court is able to carry out the operation of the Boston and Providence by promising or granting a lien to those who carry out the operation.
*140 If the Connecticut court has possession of the property and operated it under § 77 (c) (6) for its owners, could it fix a lien on the property after another bankruptcy court took the administration of the property? By § 77 (c) (6) railroads in reorganization which had been operating lines under lease were allowed to reject the lease but required to continue operation of the leased lines if the lessor had no ability to operate. Thus Congress recognized the possible occurrence of the situation now before us and evinced a desire that rail service should not in such a case be interrupted. In view of the public importance of rail service, we think this subsection represents an intention to give the court charged with operation the fullest ability to secure the necessities of operation  an intention to give the operating court power to promise those having the materials, men and equipment needed for operation a first lien on the road to secure payment for the operation.[12] This in no way impairs the operation of § 77 (a) which grants to the Massachusetts court, "during the pendency of the proceedings under this section and for the purposes thereof," "exclusive jurisdiction of the debtor and its property wherever located." The "purposes" of § 77 include the development of a "fair and equitable"[13] plan of reorganization. The Massachusetts court is left with jurisdiction to accomplish this, but is bound to recognize the priority of the lien declared by the Connecticut court. By § 77 (c) (6) the Connecticut court was given jurisdiction *141 so long as it continued to operate the road to grant a lien for operating expenses prior to any existing claims against the road. The decision of the Court of Appeals that the Connecticut court had jurisdiction to grant the lien sought by respondent is
Affirmed.
NOTES
[1]   11 U.S.C. § 205.
[2]   108 F.2d 164.
[3]   Continental Bank v. Chicago, R.I. & P. Ry. Co., 294 U.S. 648, 667-675.
[4]   Interstate Commerce Act, § 1 (18), as amended 49 U.S.C. § 1 (18):

"Extension or abandonment of lines; certificate required.  .. . and no carrier by railroad subject to this chapter shall abandon all or any portion of a line of railroad, or the operation thereof, unless and until there shall first have been obtained from the commission a certificate that the present or future public convenience and necessity permit of such abandonment."
[5]   Cf. Seaboard Air Line Railways Receivers Proposed Abandonment, 202 I.C.C. 543; Norfolk Southern R. Co. Receivers Abandonment, 221 I.C.C. 258; Meck and Masten, Railroad Leases and Reorganization: I, 49 Yale L.J. 626.
[6]   Palmer v. Massachusetts, 308 U.S. 79, 87, note 14.
[7]   § 77 (c) (6). "If a lease of a line of railroad is rejected, and if the lessee, with the approval of the judge, shall elect no longer to operate the leased line, it shall be the duty of the lessor at the end of a period to be fixed by the judge to begin the operation of such line, unless the judge, upon the petition of the lessor, shall decree after hearing that it would be impracticable and contrary to the public interest for the lessor to operate the said line, in which event it shall be the duty of the lessee to continue operation on or for the account of the lessor until the abandonment of such line is authorized by the Commission in accordance with the provisions of section 1 of the Interstate Commerce Act as amended."
[8]   Thompson v. Magnolia Petroleum Co., 309 U.S. 478; Ex parte Baldwin, 291 U.S. 610; cf. Isaacs v. Hobbs Tie & T. Co., 282 U.S. 734; Green v. Finnegan Realty Co., 70 F.2d 465, 466 (C.C.A. 5th); In re Chambers, Calder & Co., 98 F. 865 (D.R.I.).
[9]   § 77 (c) (10). "The judge may direct the debtor or the trustee or trustees to keep such records and accounts, in addition to the accounts prescribed by the Commission, as will permit of such a segregation and allocation, as the necessities of the case may require, of the earnings and expenses between and to the divisions and parts of the railroad or other property of the debtor which are separately subject to the liens of the various mortgages or deeds of trust, or are separately subject to lease, and may refer to the Commission for its recommendations after hearings thereon if the parties shall so request and/or the Commission determine necessary or desirable, as to the method or formula by which such segregation and allocation shall be made; and thereafter such segregation and allocation may be made at the expense of the debtor's estate." See note 7.
[10]   New York Dock Co. v. The Poznan, 274 U.S. 117, 120, 121.
[11]   Ibid.
[12]   It may be noted that Congress did not adopt the rule of Gross v. Irving Trust Co., 289 U.S. 342, in this situation. In the Gross case property of a debtor had been in the custody of a state receivership court prior to the debtor's adjudication in ordinary bankruptcy. It was held that because of the bankruptcy court's paramount jurisdiction the administrative expenses of the receivership had to be proved in bankruptcy and could not be declared a lien by the receivership court on property in its custody.
[13]   § 77 (e).
