Defendant operates a street railway in the city of Sioux Falls. Its franchise 'depends on Ordinance No. 392 of said city. Section 7 of such ordinance provides that, whenever a street where tracks are laid is ordered paved, defendant shall pave at its own expense that portion of the street between the rails and one foot on outer side of each rail with the same material used for paving the remainder of the street, with brick toothing next to the rails. In July, 1923, the city council by resolution ordered a section of Van Eps street paved with Portland cement concrete paving. This section of the street was being used by defendant and its tracks were laid therein. The regularity of the proceedings to pave is not questioned. Defendant refused to comply with the ordinance and the orders of the city council,* and this proceeding was brought to compel defendant by mandamus to pave as provided by the ordinance. Interveners are abutting property owners interested in the paving of the street. The trial court found in favor of the city and interveners, and rendered judgment awarding a peremptory writ of mandamus. From the judgment and an order overruling a motion for new trial, defendant appeals.
Appellant claims that mandamus ought not to issue and is not *473the proper remedy for the enforcement of respondent’s rights, because the issuance of a writ of mandamus is discretionary depending on the circumstances of each case; ¡because the right sought to be enforced is based on appellant’s franchise, which is a contract between the city and appellant to be enforced as other contracts and not by mandamus; because the franchise provides an adequate remedy without mandamus; and because appellant is unable to raise the funds necessary to comply with the mandate of the court if made.
At common law, mandamus was a prerogative writ, and its issuance was a matter of judicial discretion. While in this country the prerogative character of the writ is not as fully recognized, its issuance is still to a certain extent a matter of judicial discretion. But the" discretion is controlled by recognized rules of law, and is not to be exercised capriciously and arbitrarily. Where one has a clear legal right, with no other remedy to enforce it, the court cannot refuse the writ, if by that means the right can be secured. Moody v. Fleming, 4 Ga. 115, 48 Am. Dec. 210; Ill. Cent. Ry. Co. v. People, 143 Ill. 434, 33 N. E. 173, 19 L. R. A. 119. But it is the generally accepted rule that there may be considerations of justice which will justify a refusal of a writ, although there may be no other appropriate and adequate remedy. The right of the trial court to exercise sound discretion in allowing or refusing the writ was sanctioned by this court in Halverson v. Williams et al, 38 S. D. 176, 160 N. W. 730. The discretion rests with the trial court in the first instance, and', when exercised by that court, its judgment will not be disturbed unless an abuse of discretion is shown.
Appellant claims this action is to enforce a contract right between the -city and appellant, and for that reason mandamus is not the proper remedy. While an ordinance granting a franchise to a street railway company constitutes a contract between the city and the company, it differs from an ordinary contract between individuals, in that a privilege is conferred by law, not common to citizens of the city generally, in return' for which the grantee o-f the privilege undertakes to perform a public service imposed by law. Ruling Case Raw, vol. 12, p. 206, says:
“It has long since been settled by the better authorities that, where there is a grant and acceptance of a public franchise which *474imposes certain obligations on the corporation to which the franchise is granted, a public 'duty is thereby imposed on it, differing from an ordinary contractual duty, and that a writ of mandamus will issue, in a proper case, to 'compel the performance of such public duty.”
See, also, Chicago v. Chicago Tel. Co., 230 Ill. 157, 82 N. E. 607, 13 L. R. A. (N. S.) 1084, 12 Ann Cas. 109, and note; City of Potwin Place v. Topeka R. Co., 51 Kan. 609, 33 P. 309, 37 Am. St. Rep. 312; Township of Ross v. Michigan United Rys. Co., 165 Mich. 28, 130 N. W. 358, Ann. Cas. 1912C, 885, and note; State v. St. Paul, etc., Ry. Co., 98 Minn. 380, 108 N. W. 261, 28 L. R. A. (N. S.) 298, 120 Am. St. Rep. 581, 8 Ann. Cas. 1047; State v. St. Paul City R. Co., 117 Minn. 316, 135 N. W. 976, Ann. Cas. 1913D, 139; Bridgeton v. Bridgeton, etc., Traction Co., 62 N. J. Law, 592, 43 A. 715, 45 L. R. A. 837. If the action were to enforce some police regulation for the protection of the public, instead of paying a street, it might be more apparent that the public interest was at stake, but we think the public interest in the paving of the portion of the street between and along the rails and in the safe laying of the track in the paved street, as required by the ordinance and sought to be enforced in this action, is sufficient to justify the use of the remedy employed.
The claim that there is an adequate remedy without the writ is urged by appellant because of a provision of the ordinance allowing the city to do the paving and recover of appellant the cost if appellant refuses to act. We do not think this furnishes respondents a complete and adequate remedy. Especially is this true of the rights of the public and interveners. It may be the city has no funds defray the expense or that a proper appropriation has not been made.
Should the writ be denied if appellant is unable to obey the writ for want of funds, or ability to procure funds to pave? Obviously the plea of inability to obey does not affect the merits. The right to relief may exist, but the court is powerless to relieve. In an ordinary action, the" court would render judgment though it might be unenforceable, but because of the nature of the remedy by. mandamus, the court may refuse to order an act done, where it would be unwilling to punish as a contempt a disobedience of the order. In such case the order would not be valuable to respondents *475as a judgment for future use, and would be useless for present relief, and: courts therefore usually refuse the writ as an ineffectual and useless act. In City of Benton Harbor v. St. Joseph & B. H. St. Ry. Co., 102 Mich. 386, 60 N. W. 758, 26 L. R. A. 245, 47 Am. St. Rep. 553, a case very similar to the one at bar in many respects, the court said, concerning a plea of inability to pay for required pavement:
“It appears by the answer that the officers of the company, in the financial straits in which the defendant company is placed, cannot procure funds to do the paving; that it is an utter impossibility to do what is asked to have done. It cannot pay the current expenses, and it is 'dear that a writ of mandamus will not issue to compel the performance of an act which it is apparent the parties against whom it is directed show that they have no power to corns ply with.”
Some courts say that in such case quo warranto to forfeit the franchise and not mandamus is the proper remedy. In Ohio & M. Ry. Co. v. People, 120 Ill. 200, 11 N. E. 347, it was said:
“If, as seems to be the case, the defendant is wholly unable to discharge the duties it owes to the public, and which the law has imposed upon it, a proceeding in the nature of a quo' warranto is the proper remedy, and not mandamus.”
If the defendant has not willfully placed itself in a position where it cannot perform its legal duty, and it appears that it is unable to do so, the court should) deny the writ. In this holding we do not overlook the difficulties that may arise from a complicated: state of facts in determining appellant’s inability to procure funds, but, if the facts are such as to show such inability, then the writ will be denied.
On the issue concerning the ability of appellant to comply, there was considerable evidence introduced that does not appear to have been applicable, and some evidence was excluded by the court that apparently had a direct bearing. Appellant says that respondent has presented the facts as if this were a rate hearing and not a mandamus proceeding and have argued the facts from that standpoint. On neither side have the facts and argument been free from this criticism'. An engineer was employed by respondent to make physical valuation of appellant’s plant. The gross income, expense, fixed charges, depreciation, and interest on *476indebtedness were all considered. Appellant says the issue here is not whether the company has made a reasonable profit or whether its 'rates are sufficient, but whether it is at the present time in a financial position to perform the act sought to be enforced. This we agree is the issue, but we cannot agree with appellant’s statement that there is also- the issue of whether, if the company is compelled to pave, it would amount to practically a confiscation of its property. Appellant assumed the obligation when it accepted the franchise. Taking property to’ satisfy a legal obligation is not confiscation. There may be duties to the public so imperative that it were better to cease operations than that the duty be neglected. So long as the franchise is retained, the public is entitled to consideration. Duties to the public requiring an outlay of money are properly considered in fixing rates, which should be high enough to permit the company to fulfill all its obligations and receive a fair remuneration on the investment, but it will not do to say where the rates are not high enough public duties may be ignored. It is the duty of the company to procure and the city to allow remunerative rates. • If the rates are too low, or too much is exacted of appellant for its franchise privileges, because of the advent of motorcars and busses such evils should be remedied by appropriate action, but their remedy is not within the scope of this proceeding-. Courts will not hesitate to protect appellant’s constitutional rights, or prevent the enforcement of unjust and confiscatory rates or unreasonable changes in the franchise ordinance, but they cannot compel the city to grant a motofbus franchise, in lieu of a street railway or compel it to modify the terms of the original grant, unless impliedly it is to be adapted to changing conditions. Such changes are to be sought at the hands of the city council and the Legislature. In this case, under the issue of appellant’s ability to pave, the question is, is it physically possible for appellant to perform its duty, and not is it economically practical to do so. Mandamus is not a proceeding in equity, but a legal proceeding to enforce legal rights.
In attempting to prove its inability to raise funds necessary to pay for the pavement, the trial court excluded the testimony of Roger Mills, secretary of the traction company, concerning his efforts to borrow money for the purpose of paving. This is assigned as error. Such evidence is material if the paving cannot be *477done 'without borrowing, but, if it can be done without borrowing, then it is immaterial whether a loan can or cannot be obtained. Appellant must show that it is physically impossible for it to comply with its duty, and, as intimated in some of the decisions heretofore cited, its condition is so desperate that the court may properly find that mandamus is no longer a proper remedy and that quo warranto is. Appellant has an average monthly income of more than $10,000, as shown by Exhibit 13, with total current assets of more than $21,000. There is no evidence that the current assets, or a part of them' cannot be made immediately available, nor that a large part of the monthly income cannot be used for paving. To take all the monthly income might shut down operation and thereby destroy the income, but to take such portion as has heretofore been used for officers’ salaries, payment of taxes, interest on notes and bonds, damage claims, and other' like obligations, is not likely to .have that effect, at least not until after respondent’s rights have been secured. The burden is upon appellant to show inability to comply with the order. This appellant has failed to do.
The judgment and order appeal ad' from are affirmed.
POLLEY, SHERWOOD, CAMPBELL, and BROWN, JJ., concur.