An alternative writ of mandamus to defendant, respondent herein, was issued by the district court of Hennepin county, upon petition of relator, Hathorn, the appellant herein. Upon the hearing, the relator moved for judgment on the pleadings and for a peremptory writ. The motion was denied. Thereupon counsel stipulated in writing that the ■order to that effect should be construed upon appeal as one overruling a demurrer to defendant’s amended return.
The defendant express company, respondent, conducts offices in Minneapolis, and has adequate equipment for receiving, carrying, and ■delivering personal property by express over its several routes within •and without the state. Until October, 1904, it received and accepted all packages tendered by the relator, for compensation paid, according to its schedule of rates for the appropriate classification. Thereafter, and before the granting of this writ, on several occasions it refused to receive and accept similar packages, properly prepared and addressed, offered by relator, who at the same time duly tendered proper compensation. The charge was that the defendant intended to discriminate against the relator. The defense set forth that the relator and other *444persons were engaged in the operation of a lottery and scheme devised to defraud, under the name of “Hathorn Mutual Commission Company,” and that it might be rendered liable to criminal prosecution under the federal and state law for knowingly carrying property pertaining to lottery or fraudulent scheme. A number of controversies-were presented by the record, the determination of only one of which is essential to the decision of this case, namely, whether, upon the facts admitted, the court should grant a peremptory writ of mandamus. The decision of this question involves, first, an inquiry into the nature of mandamus and of the circumstances under which courts of law grant that extraordinary relief, and, second, into the sufficiency of the facts in this case as the basis for the issuance of that writ.
1. The common-law writ of mandamus must here be considered in-connection with section 400, G. S. 1894, providing in substance for the issuance of a writ of mandamus against common carriers to secure to-any one proffering a package transportation upon terms and conditions as favorable as those given by the common carrier for like traffic-under similar conditions to any other shipper. That remedy is expressly made cumulative. The effect of this act is to confer upon the district court judicial power to issue the writ in proper cases of the kind named. There is nothing in its express provision, in its purpose, or in its proper construction, which obliges that court to grant a writ of mandamus in violation of the general principles which precedents recognize as controlling its issuance, and which distinguish it from usual' legal process. These principles are clear and well-settled. Mandamus-is not a mere writ of right. It is “a legal remedy granted on equitable principles.”
In ordinary cases parties are left to their ordinary remedies. They are entitled to mandamus only when there are conditions of necessity or exceptional circumstances, where there would otherwise be a failure of justice, and then only in the exercise of a sound judicial discretion, and not as a matter of course. That discretion should not be exercised unless some sufficient legal purpose is to be subserved. Kendall v. U. S., 12 Pet. 524; Commonwealth v. Mitchell, 2 Pen. & W. 517; Commonwealth v. Commissioners, 1 Whart. 1; People v. Curyea, 16 Ill. 547; People v. Hatch, 33 Ill. 1, 133; People v. Illinois, 62 Ill. 510; People v. Ketchum, 72 Ill. 212; Free Press v. Nichols, 45 Vt. 7; Life & Fire Ins. *445Co. v. Wilson’s Heirs, 8 Pet. 291; Belcher v. Treat, 61 Me. 577; Davis v. County, 63 Me. 396; State v. Marston, 6 Kan. 524; State v. Stevens, 23 Kan. 456; Lamphere v. Grand Lodge, 47 Mich. 429, 11 N. W. 268; Neu v. Voege, 96 Wis. 489, 71 N. W. 880; People v. Board, 137 N. Y. 201, 33 N. E. 145; State v. Board, 26 Kan. 419; People v. State Board, 129 N. Y. 360, 29 N. E. 345; People v. McGuire, 31 Misc. (N. Y.) 324, 65 N. Y. Supp. 463; Van Akin v. Dunn, 117 Mich. 421, 75 N. W. 938; Tennant v. Crocker, 85 Mich. 328, 48 N. W. 577; MacKinnon v. Auditor General, 130 Mich. 552, 90 N. W. 329; Hale v. Risky, 69 Mich. 596, 37 N. W. 570; Donahue v. State (Neb.) 96 N. W. 1038; People v. Greene, 95 App. Div. 397; State v. City of Lake City, 25 Minn. 404; State v. Hill, 32 Minn. 275, 20 N. W. 196; 33 Cent. Dig. § 5, cols. 2053, 2054.
The persons securing its aid must come into court with clean hands. Where the proceedings have been tainted with fraud and corruption, the relief will be denied, however meritorious the application may be on other grounds. High, Extra. Leg. Rem. (3d Ed.) § 26. And see Spelling, Extra. Rel. §§ 1380, 1368, Commonwealth v. Henry, 49 Pa. St. 530, 538; State v. Buhler, 90 Mo. 560, 3 S. W. 68. Mandamus will not lie to compel the doing of an act which without its command would not be lawful. 33 Cent. Dig. § 42, col. 2116. Nor should a court allow it to compel a technical compliance with the letter of the law, when such compliance will violate the spirit of the law. Wiedwald v. Dodson, 30 Pac. 580, 95 Cal. 450.
2. The statutory provisions under which respondent fears criminal prosecution are sections 6576-6587, inclusive, and section 6312, G. S. 1894, and Act Cong. March 2, 1895; sections 3929, 4041, R. S. U. S., as amended by Act Cong. Sept. 19, 1890, c. 908, §§ 2, 3, 26 St. 466 [U. S. Comp. St. 1901, 2687, 2749]. Section 6576, just referred to, reads:
A lottery is a scheme for the distribution of property by „ chance, among persons who have paid, or agreed to pay, a valuable consideration for the chance, whether called a lottery, rafflle, or gift enterprise, or by some other name.
Section 6579 reads:
A person who sells, gives, or in any way whatever furnishes or transfers to or for another, a ticket, chance, share or interest, *446or any paper, certificate or instrument purporting to be or to represent a ticket, chance, share, or interest in or dependent upon the event of a lottery, to be drawn within or without this state, is guilty of a misdemeanor.
The defendant says it fears that it would be regarded as a principal in the commission of the offense if it knowingly transported matter offered by the relator in furtherance of its unlawful business, under section 6312 supra. The general definition of a lottery corresponds-with the statutory formula, to which reference has just been made. 5 Words & Phrases, 4245-4248, inclusive; 2 Current Law, 764, notes 34, 35; U. S. v. Wallis (D. C.) 58 Ted. 942.
The plan of the relator is, or is allied to, a lottery in the sense that it is a scheme in which the promoter for a valuable consideration distributes property to adventurers by lot or chance. Thomas, L. i\ & O., p. 19. That plan,, as set forth in a circular of the Hathorn Mutual Commission Company, was this:
When you sign an application for one or more mutual contracts, and pay the agent or the company $5 upon each contract applied for, you become a participant with all other patrons in. this mutual plan of co-operation, whereupon an explicit contract is delivered to you by the company. This contract calls for the payment of $1.25 per week for sixty consecutive weeks, making the total payment amount to $80. If yop keep up these payments for the full sixty weeks, then, when the contract is reached in the order of performance, the company will redeem the same by the payment of $160 from the redemption account, as provided in the contract. * * * The company does not invest the money paid in as instalments, nor receive the same on deposit, and assumes no liabilities further than to receive the money, place 85 cents of each $1.25 instalment paid in into the redemption-account, to redeem the lowest numbered outstanding contract, which is promptly called in and canceled as often as there is paid to the company enough of said weekly instalments to provide for such redemption, place not less than 25 cents in the expense account, to be used solely for expenses of the business, and not more than 15 cents in the commission account as and for its profits.
*447The award or prize to the person having an outstanding contract with the lowest number is determined by chance. The announced plan of the company is especially objectionable, because it is significantly silent as to the manner in which the priority in the number given to applications is determined. There is nothing expressly said on that subject. The number of the application may be determined by lot or by drawing. It may be given arbitrarily, so as to stimulate business in preferred districts by awarding the prize. If the scheme be given the most favorable construction possible, applications would be numbered in the order in which they would be received; then, if a number of applications be sent in at the same time, one might be given a higher number than a later application. Numbers given to contracts issued in accordance with applications received in the same mail must be particularly dependent upon accident. This element of chance in numbering the contracts is a violation of the antilottery law. U. S. v. Sherwood (Sup. Ct. D. C. unreported); MacDonald v. U. S., 63 Ted. 426, 431, 12 C. C. A. 339; State v. Nebraska, 66 Neb. 349, 92 N. W. 764.
The redemption of the contract in money is also in fact dependent on chance; for it is determined by new business done and lapsation. It is quite obvious that the scheme of relators can at best pay a very limited number of contracts. Many certificate holders must lose. The scheme will not “finance out.” An actuary’s computation of the situation shows the following startling result:
Assuming that only one thousand contracts are issued by the Hathorn Mutual Commission Company for the first year of its existence, and it continues doing business and paying contracts as they mature for the period of ten years, making due allowance for lapses, the company would then have on its books a membership of over 118,500,000 investors who would have paid in $80-each, or over $9,500,000,000. The company would have collected a total of nearly $14,000,000,000, out of which it would have retained as its share over $5,500,000,000, notwithstanding which, it would not have a cent on hand to pay the sum of $19,000,000,000 called for in its then outstanding contracts;
*448The most casual consideration of the plan shows it to be a plausible, dangerous, and in fact fraudulent, scheme for getting rich quick. Judge Lochren, of the United States District Court, says of the plan ■of this particular company: “It would surely happen that, at the death of the present owner and sole promoter of the concern, there would be nothing left in the way of assets. The last $160 would have gone to the last earliest certificate. It is a manifest, palpable bubble. The mere idea is fraudulent — a- means of the promoters to get money to which they have no title, and which they have not earned, from patrons who are fooled. They get what their victims lose.” Other schemes, so .similar as to show a common possession on the part of the public .of the -quality of gullibility and the habit of gambling, and on the part of promoters of paucity of invention and obliquity of moral' vision, have been repeatedly held to be lotteries, within the meaning of the federal statutes. Public Clearing House v. Coyne, 194 U. S. 497, 24 Sup. Ct. 789, 121 Fed. 927; Horner v. U. S., 147 U. S. 449, 13 Sup. Ct. 409; MacDonald v. U. S., 63 Fed. 426, 12 C. C. A. 339; U. S. v. Politzer (D. C.) 59 Fed. 273; U. S. v. Fulkerson (D. C.) 74 Fed. 619; In re National End. Co., 142 Pa. St. 450, 21 Atl. 879; McLaughlin v. National Mut. Bond & Inv. Co. (C. C.) 64 Fed. 908. And see De Florin v. State, 121 Ga. 593, 49 S. E. 699; cf. Meyer v. State, 112 Ga. 20, 37 S. E. 96.
It is admitted' that the relator and his associates have been denied the use of the United States mails under order of the Postmaster General of the United States, by authority vested in him by an act of Congress, and that the relator has been indicted by a federal grand jury for carrying on a business prohibited by the federal .statutes and is awaiting trial on said charge.
Counsel for relator has urged very earnestly that there are the same elements of uncertainty in the business of this company which occur in the business of life insurance companies, and that both are within the protection of the law. It is obvious, however, that the differences are as many as they are fundamental. The purpose and operation of a life insurance company is beneficent; the object and effect of this scheme is to enrich its promoters and defraud the public. A life insurance company invests its funds; this association does not. The ability *449of a life insurance company to meet its obligations does not depend upon either new business or lapses; that of this association depends on both. The solvency of a life insurance company is determined by commercial exigencies; that of this association is determined by chance. A life insurance company may remain solvent indefinitely; this association must become insolvent. The policies of a life insurance company are paid upon an event certain to happen, although at an uncertain time; the certificates of this association are paid according to priority in number, determined by chance, if paid at all. See memorandum of the Assistant Attorney General for the Post Office Department, in Re Empire Diamond Co.; State v. Interstate, 64 Oh. St. 383, 60 N. E. 220, 232.
The relator insists that the defendant as a common carrier was not only authorized, but commanded, as a public servant to serve all alike and to refrain from discrimination; that it had no concern with the character of relator’s business; and that it was neither his keeper nor his judge. But it is elementary that in many instances a common carrier has a right to exercise a free and reasonable discretion, as in cases of danger from the articles tendered, or of conditions rendering transportation perilous (Edwards v. Sherratt, 1 East, 604; Hutchinson, Carr. §§ 111, 113, 115); and, a fortiori, as in cases where the transportation of articles, like intoxicating liquors, is prohibited by law (Milwaukee v. Chicago, 73 Iowa, 98, 34 N. W. 761; State v. Goss, 59 Vt. 266, 9 Atl. 829. Cf. Herrick v. Gallagher, 60 Barb. 566). The trial court was the keeper of public interests, and was the judge of the propriety of giving its extraordinary remedy to aid the relator in carrying out the same fraudulent (if not illegal) scheme which the federal authorities were strenuously endeavoring to subvert and punish. The learned trial judge properly refused to lend any semblance of sanction to that improper plan, and justly held that the writ of mandamus should not issue here, because it was not made to appear that there is a legal right in the relator to the thing demanded, nor an imperative duty on the part of the defendant to perform the act required. He would have abused his discretion, if, at the instance of one not coming into court with clean hands and for a rightful purpose, but the promoter of a scheme sure to defraud, if not to deceive, he had issued compulsory process against *450a carrier, attempting not to discriminate between its patrons, but not to incriminate itself, to compel it to further the transaction of a business which in spirit, at least, if not also in the letter, violated the statutes of this state and law of the land
Order affirmed.
START, C. J., took no part.