
150 B.R. 48 (1993)
In re ETHINGTON, LeRoyce and Ethington, Cynthia, Husband and Wife, Debtors.
Bankruptcy No. 92-00350-12.
United States Bankruptcy Court, D. Idaho.
January 22, 1993.
D. Blair Clark, Ringert Clark Chartered, Boise, ID, for debtors.
Celeste K. Miller, Asst. U.S. Atty., Boise, ID, for Farmers Home Admin.

MEMORANDUM OF DECISION
ALFRED C. HAGAN, Chief Judge.
This matter is before the Court on the motion of Ronald Schoen, trustee in bankruptcy ("trustee") for LeRoyce and Cynthia Ethington ("debtors"), to disburse funds. The Farmers Home Administration of the U.S. Department of Agriculture ("FmHA") and the debtors have both filed objections to the trustee's motion.

FACTS
Debtors filed their joint chapter 12 petition on February 5, 1992. On February 27, 1992, this Court issued an order authorizing *49 the debtors to use FmHA's cash collateral. The bulk of the funds so received was distributed to the debtors; the remainder, $6,792.19, was retained by the trustee in his trust account. In addition, the trustee sold 123 head of livestock and deposited the proceeds of $82,478.87 into the trust account. After payment of attorney's fees, the trustee retained $82,425.99.
Because of apparent problems between the debtors and the FmHA over payment of federal and state taxes in the debtors' proposed plan, the debtors' case was voluntarily dismissed on December 3, 1992. Trustee filed his motion to distribute funds on December 14, 1992. This motion requested permission of the Court to pay federal and state taxes on the cattle sold during the pendency of this case, and to pay the trustee's statutory fees. The remainder was to be paid to the "[d]ebtors or any creditor as allowed or ordered by the Court." FmHA, by and through the United States Attorney, filed its objection to the trustee's motion on December 23. On that same date, the U.S. Attorney also obtained an ex parte prejudgment writ of attachment from the U.S. District Court for the District of Idaho against the funds held by the trustee. The U.S. Marshal took possession of those funds on December 28, 1992.

ISSUE
Had FmHA not decided to take matters into its own hands, the issues in this case would have turned upon the question of priority to the funds held by the trustee. However, the trustee no longer has any of the funds that were the subject of the motion to disburse. Consequently, this Court must determine what authority, if any, this Court retains to make determinations regarding the winding up of the bankruptcy. The trustee contends the actions of the FmHA violate the automatic stay. FmHA argues that the fund instantaneously vested in the debtor on dismissal, and that the prejudgment attachment was therefore appropriate because the trustee no longer had any authority to control the funds. FmHA also contends the trustee should be required to repay those funds disbursed for attorney's fees.

DISCUSSION
The initial question is whether the dismissal of the underlying chapter 12 bankruptcy in this case deprived the Court of jurisdiction to determine questions regarding the allowance and priority of trustee's fees and federal and state taxes from the funds previously held by the trustee.
FmHA has taken the position that the dismissal of the underlying bankruptcy "instantaneously" vested the property with the debtors, under 11 U.S.C. § 349, and that the trustee was therefore nothing more than a bailee on behalf of the debtors. In effect, FmHA contends the dismissal of the case deprived this Court of jurisdiction to do anything other than pay the funds held by the trustee to the debtors.
FmHA is correct that, in general, the dismissal of a bankruptcy revests the debtor's ownership rights in the property. 11 U.S.C. § 349(b)(3);[1]Nash v. Kester (In re Nash), 765 F.2d 1410, 1414 (9th Cir. 1985). See also Arkison v. Plata (In re Plata), 958 F.2d 918, 921 (9th Cir.1992). The property rights revested with a debtor under section 349 are taken subject to all encumbrances that existed prior to the subject bankruptcy. Nash, supra, 765 F.2d at 1414.
*50 The jurisdiction of this Court does not turn upon the question of who has ownership rights in the property, however. First, section 1226 provides that payments made during the pendency of a chapter 12 case in which the plan is not confirmed should be returned to the debtor only after deducting unpaid administrative expenses and the standing trustee's fee.[2] This is not inconsistent with section 349, which states the general rule that the property is revested with the debtor upon dismissal. Section 1226 deals with the specific, unique nature of chapter 12 plans, and clarifies how the trustee should deal with any unconfirmed chapter 12 plan. An unconfirmed chapter 12 plan clearly includes a plan that is unconfirmed because the underlying bankruptcy is voluntarily dismissed. Court confirmation of the statutory deductions requires that the bankruptcy court retain jurisdiction.
Second, section 349 permits the court to condition the undoing of the bankruptcy for cause. As the legislative history to section 349 states:
The basic purpose of the subsection is to undo the bankruptcy case, as far as practicable, and to restore all property rights to the position in which they were found at the commencement of the case. . . . Where there is a question over the scope of the subsection, the court will make the appropriate orders to protect rights acquired in reliance on the bankruptcy case.

H.R.Rep. No. 595, 95th Cong., 1st Sess. 338 (1977), reprinted at 1978 U.S.C.C.A.N. 5963, 6294 (emphasis added). The order dismissing the underlying bankruptcy stated: "The Court reserves jurisdiction to receive and pass upon final account and report in this case and to make orders with respect thereto." This language clearly shows that the Court retained jurisdiction to decide and determine those aspects relating to the final administration and winding up of the property.
Third, chapter 12 bankruptcies are somewhat unusual in that, while related to chapters 11 and 13, a chapter 12 case cannot be converted to chapter 7 unless the debtor has committed fraud in connection with the case or the debtor consents. 11 U.S.C. § 1208(a), (d). The debtor has the right to dismiss the chapter 12 bankruptcy at any time, unless the case has otherwise been converted. 11 U.S.C. § 1208(b). Were the Court to hold that dismissal of the case immediately revested the property in the debtor, beyond the reach of the Court to order payment of administrative fees, all parties who rendered postpetition services would be at the mercy of the debtor's decision to terminate the case and leave those expenses unpaid. See In re Fox, 140 B.R. 761, 763-64 (Bankr.D.S.D.1992) (discussing problems inherent in holding that professional fee applications must be brought before dismissal, where chapter 12 debtor can dismiss at will).
Section 349 acknowledges that some cases, such as the case at bar, have progressed so far that judicial interference is needed to unravel or preserve the rights of the parties. Read together, Section 349 and Sections 1112, 1208 and 1307 allow the bankruptcy court to retain jurisdiction over a matter after the dismissal of a case.
In re Lerch, 85 B.R. 491, 493 (Bankr. N.D.Ill.1988), aff'd, 94 B.R. 998 (N.D.Ill. 1989).
Fourth, courts have found that the bankruptcy court retained jurisdiction after dismissal to deal with numerous matters. These issues include the determination of the effect of a prior order of the bankruptcy *51 court,[3] the determination of rights to property within the constructive possession of the court,[4] the allowance of professional fee applications,[5] and the recovery on behalf of the estate of postpetition attorney's fees paid without bankruptcy court approval.[6]
Accordingly, I hold that this Court retains jurisdiction to hear and determine claims to the property prior to its return to the debtor, specifically administrative expenses and trustees' fees as set forth in 11 U.S.C. § 1226.
The trustee contends that the actions of FmHA violated the automatic stay. This is incorrect. The stay generally terminates immediately upon the dismissal of the underlying bankruptcy. Martir Lugo v. De Jesus Saez (In re De Jesus Saez), 721 F.2d 848, 851-52 (1st Cir.1983); Weston v. Rodriguez (In re Weston), 110 B.R. 452, 455-57 (E.D.Cal.1989), aff'd, 967 F.2d 596 (9th Cir.1992) (table), cert. denied, ___ U.S. ___, 113 S.Ct. 973, 122 L.Ed.2d 128 (1993).
This does not resolve the question of whether a creditor may, by bringing an action in another court, remove the property from the custody of the trustee in bankruptcy. This is generally not permitted. The property of the estate is held by the court in the person of the trustee, an officer of the court who is subject to the court's direction.
"[A]ll of [the bankruptcy trustee's] acts relate to administering property in the custody of the court or to bringing property into such custody so that it may be there administered. This situation, as an officer of the court administering property in the custody of the court, is the woof into which all of his status, duties and powers are woven. While the act [sic] (section 70a) gives him `title' to the property and while he is vested with the rights, remedies and powers of a creditor holding a legally established lien or unsatisfied execution (section 47), yet he has such title and such rights, remedies, and powers solely to place him in position better to collect into, and to preserve, transfer, and distribute the property in the custody of the court in accordance with the requirements of the act."
Red Carpet Corp. of Panama City Beach v. Miller (In re Red Carpet Corp. of Panama City Beach), 708 F.2d 1576, 1579 (11th Cir.1983) (emphasis deleted) (quoting Imperial Assurance Co. v. Livingston, 49 F.2d 745, 749 (8th Cir.1931)).
It has long been a principle of law that property held in the possession of a court lies within the exclusive jurisdiction of that court. In the case of Murphy v. John Hofman Co., 211 U.S. 562, 29 S.Ct. 154, 53 L.Ed. 327 (1909), a receiver in bankruptcy took possession of the property of a bankrupt business, including certain show cases. The manufacturer of the show cases contended that the debtor had never taken possession (even though the show cases were located on the debtor's premises and were in use), and that title therefore rested with the manufacturer. The receiver denied this allegation. The manufacturer sought replevin in state court, and the sheriff acted to replevy the show cases. On the appeal of the receiver, the Supreme Court stated:
But, where the property in dispute is in the actual possession of the court of *52 bankruptcy, there comes into play another principle, not peculiar to courts of bankruptcy, but applicable to all courts, Federal or state. Where a court of competent jurisdiction has taken property into its possession, through its officers, the property is thereby withdrawn from the jurisdiction of all other courts. The court, having possession of the property, has an ancillary jurisdiction to hear and determine all questions respecting the title, possession, or control of the property. In the courts of the United States this ancillary jurisdiction may be exercised, though it is not authorized by any statute. The jurisdiction in such cases arises out of possession of the property, and is exclusive of the jurisdiction of all other courts, although otherwise the controversy would be cognizable in them. . . . The last two cases cited proceed upon and establish the principle that when the court of bankruptcy, through the act of its officers, such as referees, receivers, or trustees, has taken possession of a res, as the property of a bankrupt, it has ancillary jurisdiction to hear and determine the adverse claims of strangers to it, and that its possession cannot be disturbed by the process of another court.
Murphy, supra, 211 U.S. at 568-70, 29 S.Ct. at 156-57 (citations omitted). Similarly, the Ninth Circuit stated that the filing of the petition in bankruptcy brought all property of the debtor into the possession of the court:
In the exercise of its jurisdiction over the debtor's property, the court had power to issue injunctions and all other writs necessary to protect the estate from interference, and to ensure its orderly administration. . . .
This ancillary jurisdiction of the reorganization court flows not only from express provisions of statute, . . . but from the inherent power of a court of equity to protect its control of a res in its custody.
Diners Club, Inc. v. Bumb, 421 F.2d 396, 398 (9th Cir.1970) (citations omitted). A recent decision of the Supreme Court in the context of forfeiture proceedings held that removal of the res from the possession of the court will not divest the court of jurisdiction so long as a judgment would have any effect. Republic Nat'l Bank v. U.S., ___ U.S. ___, ___ - ___, 113 S.Ct. 554, 557-59, 121 L.Ed.2d 474 (1992) (U.S. Marshal's turnover of property to U.S. Treasury as prevailing party did not divest appeals court of jurisdiction).
The actions of FmHA do not necessarily fall within these general statements of law. FmHA obtained its writ of attachment from the U.S. District Court for the District of Idaho. Bankruptcy courts are units of the district court, and bankruptcy judges are judicial officers of the district court. 28 U.S.C. § 151. The primary grant of bankruptcy jurisdiction is to the district courts, not the bankruptcy courts. See 28 U.S.C. 1334. The district courts may, but need not, refer any or all cases sufficiently related to Title 11 of the United States Code to the bankruptcy judges of that district. 28 U.S.C. § 157(a). Such reference is generally automatic. This reference does not end the district court's jurisdiction over the case, however; on the motion of an interested party or sua sponte, the district court may at any time for cause shown withdraw this reference to the bankruptcy court. 28 U.S.C. § 157(d).
There is authority that a deliberate, informed act of the district court that is inconsistent with the bankruptcy court's continued jurisdiction acts as a withdrawal of reference. Cooper-Jarrett, Inc. v. Central Transport, Inc., 726 F.2d 93, 95-96 (3d Cir.1984). It is not clear from the record before this Court that the district court was given information such that its action was deliberate and informed. The district court's prejudgment attachment was issued ex parte, and the court may not have been informed of the pending motion before this Court, or may not have been informed of the existence of the debtors' chapter 12 filing. However, this Court may not hear or determine a motion to withdraw reference; this matter is left to the exclusive province of the district court. 28 U.S.C. § 157(d); Oneida Motor Freight, Inc. v. Felsway Corp. (In re Oneida Motor *53 Freight, Inc.), 86 B.R. 344, 346-47 (Bankr. D.N.J.1987). It would accordingly be inappropriate for this Court to issue any opinion with regard to whether the district court has in fact withdrawn reference.
The spectacle of one officer of the court (the U.S. Marshal) taking property from another officer of the court (the trustee) is completely unnecessary, and suggests the reason for the formulation of the doctrine that property within the custody of the court is subject to that court's exclusive jurisdiction.
Property in custodia legis is not attachable because of "the desirability of avoiding a clash between judicial jurisdictions which would result from any attempt to use the process of one to seize assets in the control of another judicial authority."
B & G Ltd. v. Levin (In re Meter Maid Indus., Inc.), 462 F.2d 436, 438 (5th Cir. 1972) (quoting In re Quakertown Shopping Center, Inc., 366 F.2d 95, 97 (3d Cir. 1966)).
There was no hint of any risk that the funds held by the trustee would be distributed without due consideration for all of FmHA's rights. No party (other than FmHA) contended at any point that this Court had no jurisdiction or right to determine the property interests in the fund.
Because the order of the district court may indicate an intention to withdraw reference from this Court; because this Court no longer possesses custody of the fund subject to the motion; because this is a matter of first impression within this district; and because the district court holds the primary grant of jurisdiction over bankruptcy matters, this Court will defer any ruling on the trustee's motion and it is suggested the chapter 12 trustee or the debtors seek a withdrawal of the reference in this case to facilitate the winding up process in the district court.
NOTES
[1]  Section 349(b) provides:

(b) Unless the court, for cause, orders otherwise, a dismissal of a case other than under section 742 of this title 
(1) reinstates 
(A) any proceeding or custodianship superseded under section 543 of this title;
(B) any transfer avoided under section 522, 544, 545, 547, 548, 549, or 724(a) of this title, or preserved under section 510(c)(2), 522(i)(2), or 551 of this title; and
(C) any lien voided under section 506(d) of this title;
(2) vacates any order, judgment, or transfer ordered, under section 522(i)(1), 542, 550, or 553 of this title; and
(3) revests the property of the estate in the entity in which such property was vested immediately before the commencement of the case under this title.
11 U.S.C. § 349(b).
[2]  Section 1226 provides in its relevant part:

(a) Payments and funds received by the trustee shall be retained by the trustee until confirmation or denial of confirmation of a plan. If a plan is confirmed, the trustee shall distribute any such payment in accordance with the plan. If a plan is not confirmed, the trustee shall return any such payments to the debtor, after deducting 
(1) any unpaid claim allowed under section 503(b) of this title; and
(2) if a standing trustee is serving in the case, the percentage fee fixed for such standing trustee.
11 U.S.C. § 1226(a).
[3]  See Beneficial Trust Deeds v. Franklin (In re Franklin), 802 F.2d 324, 326 (9th Cir.1986).
[4]  See Wesley Medical Center v. Wallace (In re Wallace), 46 B.R. 807 (Bankr.W.D.Mo.1984). In Wesley, the debtor filed bankruptcy under Chapter 13. Some $25,000 was paid into the registry of the bankruptcy court. The $25,000 was paid by mistake to the debtor and debtor's counsel, and the debtor subsequently moved to dismiss its bankruptcy. The court granted this motion, but concluded the debtor and counsel were nonetheless required to return the funds to the court. The court held the money remained within the court's jurisdiction and constructive possession, and it could enforce its order to return the money by appropriate sanctions.
[5]  See Fox, supra, 140 B.R. at 762; In re Mandalay Shores Cooperative Housing Ass'n, 60 B.R. 22 (Bankr.M.D.Fla.1986). In Fox, the court held that it would have retained jurisdiction over the application for fees by the debtors' attorney in a Chapter 12 case, even had such jurisdiction not been reserved in the order dismissing the case. Id.
[6]  See Willis v. Cruse (In re Samford), 125 B.R. 230, 234 (E.D.Mo.1991).
