GATES; J.
Prior to September 1, 1912, respondent owned a building in Waubay, S. D., in one department of which it op*392erated an electric light plant, and in the other part conducted an automobile business. From the town water mains there ran two service pipes, the north pipe into the electric light plant, and the south pipe into the garage. Prior to July i, 1912, the town authorities directed that meters should be placed on all service pipes. Respondent placed one on the'south pipe. On July 6, 1912, the north pipe was shut off by direction of the town officials for failure of respondent to attach a meter. Prior to that time water had flowed through both pipes. It is claimed by respondent that, as a part of its contract with the town, the town was to furnish free water to the electric light plant. After such shut-off, respondent cut a lead from the south pipe into the electric light department, and used water therefrom until some time in August, when respondent’s secretary opened the north pipe, and used water therefrom for the electric light plant until about September 11, 1912, when it was shut off -by the town marshal by direction of appellants. Respondent then brought this action to enjoin defendants, as trustees of the town of Waubay, “from preventing water from flowing through a certain pipe from -the mains of said town of Waubay to -be used for cooling the engine cylinders of certain gasoline engines used by it for the purpose of propelling dynamos” in its electric light plant. On September 13, 1912, the trial court issued a restraining order, which was served on appellants on the same day. The essential parts of said order are as follows: “It is ordered that the defendants, and each of them, together with their attorneys, agents, and servants, immediately be and they are hereby restrained and enjoined from, in any manner obstructing the flow of water, or continuing an obstruction to the flow of water, through said pipe from the water mains of said town and into the electric light plant of the plaintiff company during the pendency of this action or until further order of the court, and that defendants immediately cause the water to flow through said pipe from said mains and into the electric light plant of plaintiff company in the manner as it did prior to the nth day of September, 1912.”
On September 17, 1912, the court, upon an affidavit showing disregard of the restraining order, issued an order requiring appellants- to show cause why they should not be adjudged in contempt of court. On September 19, 1912, respondent’s secretary *393again opened up the north pipe. Appellants answered, testimony was taken, and the court on September 24, 1912, rendered a judgment thereon. The material parts of the judgment and of the facts therein recited are as follows: “That the defendants, after the service of said restraining order upon them, entirely ignored the same, and have failed, refused, and neglected to comply with the terms' thereof, and did not, as directed by said restraining order, cease to maintain obstruction to the flow of water through the pipe leading from the water mains of said town into the electric light plant of plaintiff company, and that they failed and neglected to cause the water to flow through said pipe from said mains and into the electric light plant of plaintiff company in accordance with the command of said order, or at all. That in said pipe leading from the water mains of said town and into the electric light plant of plaintiff company the defendants maintained and permitted to 'be maintained an obstruction to the flow of water therethrough and into the electric light plant of plaintiff up to and until the 19th day of September, 1912, when said obstruction was removed 'by an officer of plaintiff company without the knowledge and consent’ of said defendants, or either of them. That thereafter, and prior to the hearing in this matter, the defendant printed and procured and caused to be printed and distributed broadcast in said town of Waubay, in a form which is commonly known as a dodger or handbill, .the following: '50.00 Reward, for information leading to the arrest and oonviction of the person or persons who tampered with the north water pipe cut-off leading into' the Wau-bay Motor Sales Co.’s building on the night, of September 19, 1912. Town of Waubay, by G. G. Lasell, George K.uhn, and F. J. Telschow, Board of Trustees.’ That by reason of the facts aforesaid it is considered and adjudged that the defendants and each of them have willfully disregarded, disobeyed, and failed to comply with the said order of this court, and are guilty of contempt of court. And it is further ordered and adjudged that the defendants forthwith cause to be printed in the English language, over their signatures, a handbill or dodger in size at least equal to the one containing an offer of reward, and hereinbefore set out, stating in substance that said offer of reward was unwarranted, and is hereby retracted and recalled, and that the same be given as wide circulation and publicity as was given the said handbill *394or dodger containing the said offer of reward.” Then follows an extremely mild monetary punishment, which was in substance an award to. respondents for its attorney’s fees and expenses on the hearing.
The testimony of appellants tends to show that they were ignorant of the fact that water was for a time prior to September ii, 1912, running through the north pipe; but, on the other hand, it shows that they took no steps to ascertain the true condition of affairs, and failed utterly to comply with that part of the restraining order which required them to “immediately cause the water to flow through said pipe from said mains and into the electric light plant of plaintiff company (respondent) in the manner as it did prior to the nth day of September, 1912.” One of the appellants testified: “I did not know that the water was not flowing to the electric light plant. I did not try to find out.” With the merits of the controversy between the parties, we have at present no concern nor can we consider the propriety of the conduct of respondent’s secretary in tampering with the water main after it was shut off by town authority. The question before us is whether the court made a lawful order, and, if so, whether it was violated.
[1] The only point raised by appellants which merits consideration is as to the authority of the trial court to make the affirmative direction last above quoted in and as a part of the restraining order. It is urged by appellants that such direction was not properly a part of the restraining order, and was void, and therefore its disobedience was not a contempt of court; that injunction is not the proper remedy for undoing a thing already done. Section 197, C. C. P., authorizes the granting of an injunction not only to restrain the commission, but also the continuance of some act, the commission or continuance of which during the litigation would produce injury to the plaintiff. In Magpie Gold Min. Co. v. Sherman, 23 S. D. 232, 121 N. W. 770, 20 Ann. Cas. 595, this court said, “While mandatory injunctions are not favored by the courts, they are nevertheless permissible in certain special cases,” citing Pligh on Injunctions, § 358, and 22 Cyc. 742. In Lawrence v. Ewer, 21 S. D. 580, 114 N. W. 709, an injunction was sustained by this court which prohibited defendants from continuing the obstruction of a highway, and the ineffective*395ness of requiring applicant to pursue his remedy at law was therein discussed on page 586 of 21 S. D., page 709 of 117 N. W. In Falcon v. Boyer, 142 N. W. 427, the Supreme Court of Iowa said: “It is next contended that the decree of the court is wrong in that it contained a mandatory order on the defendant. Upon this point we have to say that, while the office of an injunction primarily is to restrain, and not to compel, the performance of an act, yet, if it be necessary in order to make the restraining order effectual, the party against whom it is issued may be required to perform some affirmative act which will make effectual the main and controlling purpose of the order. It cannot be maintained that, because an injunction primarily is to restrain, and not to compel, the performance of an act, it cannot be used, when the effect of yielding obedience thereto requires the performance of some affirmative act. That is, the court may grant an injunction, the essential nature of which is to restrain, although, in yielding obedience to the restraint, the party may be required to perform some affirmative act. Otherwise often the injunction would be ineffectual” — citing Allen v. Stowell, 145 Cal. 666, 79 Pac. 371, 68 L. R. A. 223, 104 Am. St. Rep. 80, and Troe v. Larson, 84 Iowa, 649, 51 N. W. 179, 35 Am. St. Rep. 336. We approve the reasoning of the Iowa court, and are clearly of the opinion that in the present case the effectual carrying out of the main purpose of the restraining order authorized and required the affirmative matter contained therein.
[2] We are also clearly of the opinion that appellants were not justified in sitting still and doing nothing upon the receipt of the order. It was incumbent upon them to immediately ascertain the true facts in relation to the condition of the water main leading into the electric light plant. It was incumbent upon them to immediately put that main in the condition in which it was prior to September n, 1912. The order was a lawful order; the appellants violated it, consequently they were properly adjudged in contempt of court.
Finding no error in the record, the judgment of the tidal court is affirmed.