This is an application for a writ of habeas corpus. The petitioner was tried and convicted *275of a misdemeanor under the following ordinance of the city of Los Angeles: —
“ The mayor and the council of the city of Los Angeles do ordain as follows: —
“ Sec. 1. Eight hours’ labor constitutes a legal day’s work in all cases where the same is performed under the authority of any ordinance, resolution, or contract of the city, or under the direction, control, or by the authority of any officer of the city, acting in his official capacity; and a stipulation to that effect must be made a part of all contracts to which the city as a municipal corporation is a party.
“ Sec. 2. It shall be unlawful for any contractor, by himself or through another, when having labor performed under any contract with the city, to demand, receive, or contract for more than eight hours’ labor in. one day from any person in his employ or under his control, with the promise or understanding that such person so laboring over eight hours shall receive a sum for said day’s work more than that paid for a legal day’s work.
“ Sec. 3. It shall be unlawful for any contractor, by himself or through another, when having labor performed under any contract with the city, to employ Chinese labor thereon.
“Sec. 4, Any person or persons violating any of the provisions of this ordinance shall be deemed guilty of a misdemeanor, and on conviction thereof shall be punished by a fine of not less than ten dollars nor more than fifty dollars for every such offense.”
It is claimed in support of the petition that this ordinance was unconstitutional and void. We think this objection is well taken. It is simply an attempt to prevent certain parties from employing others in a lawful business and paying them for their services, and is a direct infringement of the right of such persons to make and enforce their contracts. If the services to be performed were unlawful or against public policy, or the *276employment were such as might be unfit for certain persons, as, for example, females or infants, the ordinance might be upheld as a sanitary or police regulation, but we cannot conceive of any theory upon which a city could be justified in making it a misdemeanor for one of its citizens to contract with another for services to be rendered because the contract is that he shall work more than a limited number of hours per day. Mr. Cooley, in his work on Constitutional Limitations, says: —
“ The general rule undoubtedly is, that any person is at liberty to pursue any lawful calling, and to do so in his own way, not encroaching upon the rights of others. This general right cannot be taken away. It is not competent, therefore, to forbid any person or class of persons, whether citizens or resident aliens, offering their services in lawful business, or to subject others to penalties for employing them. But here, as elsewhere, it is proper to recognize distinctions that exist in the nature of things, and under-some circumstances to inhibit employments to some one class by leaving them open to others. Some employments, for example, may be admissible for males and improper for females, and regulations recognizing the impropriety and forbidding women engaging in them would be open to no reasonable objection. The same is true of young children, whose employment in mines and manufactories is commonly, and ought always to be, regulated. And some employments in which integrity is of vital importance, it may be proper to treat as privileges merely, and to refuse the license to follow them to any who are not reputable.”
For these reasons, we hold the ordinance, so far as it attempts to create a criminal offense, to be void, and that the petitioner should be discharged.
It is so ordered.