moment. The same exemption from judicial interference applies to all legislative bodies, so far as their legislative discretion extends. Municipal corporations are instrumentalities of the state for the more convenient administration of local affairs, and for that purpose are invested with certain legislative power. In the exercise of that power, upon the subjects submitted to their jurisdiction, they are as much beyond judicial interference as the legislature of the state. The courts cannot in the one ease forbid the passage of a law nor in the other the passage of a resolution, order, or ordinance. If by either body, the legislature or the board of supervisors, an unconstitutional act be passed, its enforcement may be arrested. The parties seeking to execute the invalid act can bo reached by the courts, while the legislative body of the state, or of the municipality, in the exercise of its legislative discretion, is beyond their jurisdiction. The fact that in either case the legislative action threatened may bo in disregard of constitutional restraints, and impair the obligation of a contract, as alleged in this case, does not affect the question. It is legislative discretion which is exorcised, and that discretion, whether rightfully or wrongfully exercised, is not subject to interference by the judiciary.
A municipal corporation may be clothed, and generally is clothed, with other than legislative powers, and in their exercise may, in many instances, be brought under the jurisdiction and control of the courts. If, for instance, it be the holder of property as trustee, it may be required to execute the trusts assumed, and'to make such disposition of the property as the trust requires. If, being the owner of property, it contracts for its sale, the execution of the contract can be enforced as in the case of such contracts by natural persons. So, also, if it attempt to act upon matters not by its charter or law subject to its jurisdiction, it may be reminded of the limitations upon its powers, and brought to a more careful consideration of them, by the process of the courts; and if the rights of third parties will be injuriously affected by its proposed action, it may bo enjoined therefrom. It matters not in such cases that its action takes the form of legislation, when it is not, in fact, the exercise of legislative power, or upon a matter which is committed to its jurisdiction.
In what we have said of the want of authority in courts of equity over the action of a municipal corporation, we confine ourselves strictly to such action as is purely legislative, upon a matter which is, by its charter or law, made subject to its legislative discretion. That the exercise of such legislative discretion of municipal bodies shall bo exempt from judicial restraint, is declared in the laws of this state. Among the provisions of the Civil Code is one which provides that an injunction cannot be granted “to prevent a legislative act by a municipal corporation.” This was enacted in March, 1874, and is, we think, declaratory of sound doctrine, though often disregarded in practice by the courts.
With special force may this doctrine be invoked in the present case, when, in a controversy between citizens of the same state, the restraint of legislation by the city of San Francisco, which the courts of the state