
165 F.2d 111 (1947)
TEXAS CO.
v.
MILLER. In re SITTON & HERBERT.
No. 12142.
Circuit Court of Appeals, Fifth Circuit.
December 30, 1947.
*112 F. T. Baldwin, of Houston, Tex., for appellant.
O. C. Funderburk, of Tyler, Tex., for appellee.
Before HUTCHESON, WALLER, and LEE, Circuit Judges.
WALLER, Circuit Judge.
Under the statutes of Texas, Articles 7065b  1 to 7065b  29, Vernon's Annotated Civil Statutes of Texas, the user of gasoline in tractors, stationary gas engines, motor boats, and the like is entitled to a refund of the gasoline taxes paid the State upon a presentation of an exemption certificate issued by a licensed refund dealer and other documents showing that the gasoline was not used on the highway and that the taxes thereon had been paid by the claimant of the refund.
The Texas Company, through its consignee, a "licensed refund dealer," sold gasoline on credit to Sitton & Herbert, *113 making separate charges on its books of account for the price of gasoline and for the tax on the gasoline. It then, on or before the time required by Texas statute, paid to the State the taxes imposed by law upon the gasoline so sold. The purchasers, however, never paid the account nor refunded the taxes which Appellant, the sellers, had paid to the State. Instead they went into bankruptcy. Appellee was appointed as Trustee.
All the gasoline so sold to the bankrupts was purchased for non-highway use, and upon the claim for refund of said taxes, seasonably filed by the Trustee in Bankruptcy, a warrant of the State Comptroller for the amount of the taxes, in the sum of $2249.77, was issued to, and cashed by, the Trustee, who now holds the proceeds, although neither he nor the bankrupts ever paid the taxes, thus refunded, either to the State or to The Texas Company.
The Texas Company successfully contended before the Referee in Bankruptcy that upon equitable principles of subrogation, equitable liens, or constructive trusts, it was entitled to the restitution of the taxes paid by it and refunded to the Trustee, in order to prevent the unjust enrichment of the bankrupts at its expense.
The Referee held that Appellant was entitled to priority and ordered the Trustee to pay over the fund accordingly. On petition for review the lower Court reversed the Referee and held that The Texas Company was not entitled to priority in payment.
The ultimate question presented by this appeal is whether or not, under Articles 7065b  1 to 7065b  29, Vernon's Annotated Civil Statutes of Texas, a refund dealer who sells gasoline on credit to a purchaser for a non-highway use and charges the account of the purchasers, separately, with the gasoline and with the taxes, which taxes the seller, in compliance with the statute, thereafter paid to the State, and which the purchaser failed to repay to the seller, but on the contrary secured a refund of those taxes from the State through his Trustee in Bankruptcy, should, in bankruptcy, have a prior claim against the Trustee for the taxes so refunded?
Before making answer to that question it is appropriate to ascertain the nature of the statutory obligations of the seller and of the purchaser of gasoline for the payment of the State taxes thereon.
Sec. 2(a) of Article 7065b of Vernon's Annotated Civil Statutes of Texas provides that every distributor who makes a first sale of motor fuel shall "collect the said tax from the purchaser or recipient of said motor fuel, in addition to his selling price, and shall report and pay to the State of Texas the tax so collected * * *." Also, "the said tax shall be added to the selling price, so that such tax is paid ultimately by the person using or consuming said motor fuel * * *."
Sec. 3(a) provides that: "Every distributor who shall be required to collect the tax levied by this Article upon the first sale or distribution of motor fuel in this State, * * * shall upon the 20th day of each calendar month remit or pay over to the State * * * the amount of such tax required to be collected during the calendar month next preceding * * *." Sec. 3 (c) provides that "If any distributor shall fail to remit proper taxes collected upon the first sale or distribution of motor fuel," the distributor shall pay an additional penalty, etc.
Secs. 4(a) and (b) provide that all taxes collected by a distributor shall be for the use and benefit of the State of Texas and that if any such collector shall willfully fail or refuse to pay same to the State, he shall be guilty of a felony.
Subsection (d) of Sec. 13 of said article provides that the Comptroller may refund taxes paid on gasoline not used on the highway "if he finds that such claims are just, and that taxes claimed have actually been paid by claimant, * * *." (Emphasis added.)
Subsection (h) of Sec. 13 provides: "In no event shall any refund be made to any person in excess of the actual amount paid by such person, * * *." (Emphasis added.)
Subsection (j) of Sec. 27 provides that "whoever shall knowingly purchase or receive from a distributor motor fuel upon *114 which a tax is required to be paid, without said tax being a part of the consideration involved in such transaction * * *" shall be guilty of a felony.
We conclude from the foregoing provisions of the statute that the obligation to pay the gasoline tax is definitely the primary obligation of the buyer of such gasoline, and the duty to collect and remit the tax is definitely the primary obligation of the distributor. The seller of gasoline is a collecting agency for the State and authorized and required to collect same from the purchaser and transmit it to the State. We are influenced toward this view because of the statutory provisions: (1) That the distributor is allowed one per cent of the tax for expense of collection; (2) that it is a felony to collect the tax and not turn it over to the State; (3) that it is a criminal offense for one to purchase tax-free gasoline from a distributor, Sec. 27(j); (4) that a refund for taxes paid on gasoline not used on the highway cannot be obtained except upon a showing that the claimant for refund has actually paid the tax; (5) that the distributor is required to "collect the said tax from the purchaser"; (6) that "the said tax shall be added to the selling price, so that such tax is paid ultimately by the person using or consuming said motor fuel * * *."
We think that these statutory provisions definitely show that the obligation to pay the tax is on the consumer.
In the case here, Appellant, as a distributor, was required to collect the tax and to remit it to the State, but the obligation was on the purchaser to pay, or to bear, the tax. Upon a sale, it was the statutory duty of the seller to issue an "invoice of exemption" when demanded by the purchaser of motor fuel intended not to be used on the highway, and such exemption invoices were regularly issued in this case to the purchaser since the gasoline was not to be used on the highway. The Trustee, using these exemption invoices plus the usual affidavits, secured a warrant from the Comptroller for the refund of gasoline taxes which The Texas Company  not Sitton & Herbert  had paid, and if the estate of the bankrupts is allowed to retain the refund, it will be unjustly enriched to the full extent thereof. It will have gotten $2,249.77 out of the State as a refund of taxes which it never paid but which the law required the distributor of the gasoline to remit by the 20th of each month. The failure to collect from the purchaser did not excuse the distributor from the statutory duty to make the remittance to the State.
The Appellant contends that, since it was required by the law to pay the taxes which Sitton & Herbert owed, but failed to pay, a right of subrogation arises in its favor as to the taxes so refunded to the Trustee in Bankruptcy of the delinquent taxpayer.
The contract between the distributor and the purchaser was not illegal. No law or public policy of Texas, of which we have any knowledge, was violated in making a sale of gasoline on credit. The provisions of the law making the distributor a collector of the tax and requiring it to remit may be fraught with the hazard to the seller of a loss by way of taxes in excess of the initial cost of the gasoline to the seller, such as is the usual hazard of sales on credit, but such a transaction is not illegal. The State of Texas has been in no wise defrauded. It received the tax which the law demanded and it refunded the tax on gasoline not used on the highway which the law also demanded, but it refunded it to one who had not actually paid the tax and to whom the State was under no obligation to refund. The State had no right to retain, upon an appropriate application for refund, taxes on non-highway gas when the law directs its refund, but its obligation to refund such taxes is to refund it to the claimant who has actually paid the tax.
It can hardly be denied that it would be unjust for The Texas Company to pay the tax which its customer owes and then to allow the customer who did not pay the tax to be refunded the amount thereof. Such a transaction in effect would be the taking of the seller's money and indirectly, but effectively and gratuitously, handing it over to the seller's customer. Equity does *115 not look with favor on the unjust enrichment of one person at the expense of another and will generally exercise its offices either by applying the principle of subrogation or by declaring the existence of a constructive trust or of an equitable lien in prevention thereof.
Do the circumstances here make out a case for the application of the doctrine of legal subrogation in a court of equity, such as is a court of bankruptcy?
In 39 Tex.Jur., Sec 2, pages 754 and 755, subrogation is defined as:
"Subrogation is said to be a legal fiction by force of which an obligation, extinguished by payment made by a third person, is treated as still subsisting for his benefit; or, as it has been otherwise defined, it is the procedure by which the equitable rights of one person are worked out through the legal rights of another. By subrogation a court of equity, for the purpose of doing exact justice between parties in a given transaction, places one of them, to whom a legal right does not belong, in the position of a party to whom the right does belong."
In 39 Tex.Jur., page 760, Sec. 7, it is stated:
"Subrogation arises out of and depends upon the nature of the transaction, being the mode which equity adopts to compel the ultimate payment of a debt by the person who in equity and good conscience ought to pay. As has been judicially observed,
"`The parties may not have had subrogation in their minds at all when they made the contract, but that fact alone would not control in a question of application of the doctrine. Equity will apply it, though the parties may never have thought of it, if it is not inconsistent with the contract or in violation of any one's legal rights, and if justice demands it.'[1]
"But it is usually only in cases where the person who paid the debt of another did so in the performance of a legal duty or for self-protection that equity will substitute the payer in place of the creditor, as a matter of course, without any agreement to that effect."
In Galbraith-Foxworth Lumber Co. v. Long, Tex.Civ.App., 5 S.W.2d 162, 167, it was said:
"A court of equity, when it becomes necessary to do exact justice between parties in a given transaction, may place one of these parties, to whom a legal right does not belong, in the position of a party to whom the legal right does belong. This mode, adopted for the purpose of doing justice, is termed `subrogation.' Murphy v. Smith, Tex.Civ.App., 50 S.W. 1040; First National Bank v. Ackerman, 70 Tex. 315, 8 S.W. 45; Faires v. Cockerell, 88 Tex. 428, 31 S.W. 190, 639, 28 L.R.A. 528; Williston on Contracts, § 1265; 25 R.C.L., p. 1322, § 10 et seq. This doctrine is broad enough to include every instance in which one party pays a debt for which another is primarily answerable, and which in equity and good conscience should have been discharged by the latter, so long as the payment was made either under compulsion or for the protection of some interest of the party making the payment and in discharge of an existing liability. Gerseta Corporation v. Equitable Trust Co. et al., 241 N.Y. 418, 150 N.E. 501, 43 A.L.R. 1320; Sheldon on Subrogation (2d Ed.) pp. 2 and 4; Harris' Law of Subrogation, p. 2. The right of subrogation is not dependent upon contract, agreement, or stipulation, or upon privity or strict suretyship; but it is a mode which equity adopts to compel the ultimate payment of a debt, by one who, in justice, equity, good conscience, ought to pay it."
In First State Bank v. Farmers' and Merchants' National Bank, Tex.Civ.App., 262 S.W. 225, 226, we find the following language:
"The doctrine of subrogation originated in equity, and is the procedure by which the equitable rights of one person are worked out through the legal rights of another. Subrogation exists by operation of law, when one having a liability or owning an interest, or occupying a fiduciary relation in the premises, pays the debt of another under such circumstances as in equity he will be deemed entitled to the security or *116 obligation held by the creditor whose claim has been paid. This is known as legal subrogation."
An illuminating discussion of subrogation is found in this Court's opinion in Stowers v. Wheat, 5 Cir., 78 F.2d 25.
We do not have here a case of conventional subrogation but of legal subrogation that arises by operation of law. "Subrogation arises by operation of law where a person has been compelled to pay off a prior encumbrance in order to protect himself, or where he has paid the debt of another in such circumstances that equity will afford him the security or obligation held by the creditor whose claim has been paid." 39 Tex.Jur., page 757. See Pomeroy's Equity Jurisprudence, Volume 5, Sec. 2343. See Restatement of the Law of Restitution, Sec. 162, Subrogation.
The doctrine of subrogation has been held applicable to a case somewhat similar to this one in Texas Company v. Blue Way Lines, Inc., 1 Cir., 93 F.2d 593.
In the present case, The Texas Company paid a tax to the State that was the ultimate and primary obligation of the bankrupts. It did not pay the same voluntarily but paid it under compulsion of law and thereby secured from the State of Texas the right to receive the monies which the State held for such claimant as had actually paid the taxes on non-highway gasoline.
We think, too, that a court of equity should declare a constructive trust to exist in this case in order to prevent the unjust enrichment of the bankrupt estate at the expense of the Appellant. In 28 Tex. Jur., page 13, Sec. 9, there is found this statement:
"Whenever one person has obtained money which does not equitably belong to him and which he cannot in good conscience retain or withhold from another who is beneficially entitled to it, a constructive trust will arise, whether the money came into the possession of such person by accident, mistake or fraud; * * *"
In 42 Tex.Jur., page 649, Sec. 45, a constructive trust is defined as "a trust that is impressed on property, without regard to the intention of anyone, in order that the owner may be held to account as trustee and that the property may be followed in the hands of third persons who are not innnocent purchasers. So viewing the transaction, a court of equity is enabled to frustrate fraud and work complete justice, and this is its purpose in raising a trust by construction. * * * And distinguishing `constructive' from other kinds of trust, the Restatement of the American Law Institute reads:
"`Both express trusts and resulting trusts are based upon a manifestation of intention of the person who creates them. . . . On the other hand, a constructive trust is imposed not to effectuate intention, but to redress wrong or unjust enrichment. A constructive trust is remedial in character.'"
In Gillean v. Witherspoon, Tex.Civ.App., 121 S.W. 909, it was said text, page 913:
"It is a well-recognized principle in equity that if a person obtains the legal title to property by such arts or acts or circumstances, or circumvention, imposition or fraud, that he ought not, according to the rules of equity and good conscience as administered in chancery, to hold and enjoy the benefical interest of the property. Courts of equity, in order to administer complete justice between the parties, will raise a trust by construction out of the circumstances or relations; and this trust they will fasten upon the conscience of the offending party, and will convert him into a trustee of the legal title and order him to hold it for the original owner or to execute the trust in such manner as to protect the defrauded party and promote the safety and interest of society. 1 Perry on Trusts, § 166."
In Pomeroy's Eq.Juris., vol. 3, p. 2397, Sec. 1051, the author states:
"A constructive trust arises whenever another's property has been wrongfully appropriated and converted into a different form. . . . It is not essential for the application of this doctrine that an actual trust or fiduciary relation should exist between the original wrongdoer and the beneficial owner. Whenever one person has wrongfully taken the property of another, and converted it into a new form, or transferred it, the trust arises and follows the property or its proceeds."
*117 So even if the doctrine of subrogation were as hedged about with conditions and restrictions in limitation of the remedy as is contended by Appellee, the Appellant ought to be able to have the Appellee declared a constructive trustee of the fund so as to prevent the unjust enrichment of the bankrupt estate at Appellant's expense. Equity will not suffer a wrong without a remedy. The estate of the bankrupt was entitled to no such windfall as it received here. It obtained a refund to it of taxes that it never paid. The State was not entitled to keep, as against the one who paid them, the taxes on gasoline that was used off the highway. The State is not here claiming the fund, even though it had the right and duty to have withheld it from the estate of the bankrupts, which stands here as the gratuitous refundee of a tax that it never paid.
The judgment of the Court below is reversed and the cause is remanded with directions to enter a decree in favor of Appellant.
Reversed and remanded.
LEE, Circuit Judge, concurs in the result.
NOTES
[1]  E. Y. Chambers & Co. v. Little, Tex. Civ.App., 21 S.W.2d 17, 22, quoting Southern Cotton Oil Co. v. Napoleon Hill Cotton Co., 108 Ark. 555, 158 S.W. 1082, 46 L.R.A.,N.S., 1049.
