Petitioner was arrested and held in custody under a writ issued by W. H. Leas, as Mayor of the city of Des Moines, for an offence against the ordinances of said city. In his petition, he claims that said Leas is not the mayor of said city, that he was never elected as such mayor, and that he had no power or authority to issue said writ. The answer shows that said Leas was declared duly elected, that a certificate of election was issued in due form by the proper officer, that he took the oath and executed the bond required by la\y, entered upon the discharge of his duties, and was in the exercise of the same as such mayor, at the time of issuing said writ.
• To this answer a demurrer is interposed, claiming, in substance, that it does not show that said Leas was the mayor de jure, and that though an officer de facto, this would not authorize him to exercise the duties, issue the writ, and hold the petitioner in custody.
There is a clear distinction between a bold, unwarranted assumption of right to exercise the duties of an officer and their exercise under color of right. If A, without any pretense of an election or an appointment to an office, or without any claim of right, should issue a process and cause the arrest of an alleged offender, we would not hesitate to hold the restraint illegal and discharge the prisoner. But where it appears, as in this answer, that no other person was exercising or discharging the duties of the office that the incumbent had been declared duly elected, received his certificate of election, filed his bond, and entered upon the *371discharge of his duties, and was in the exercise thereof, in issuing the writ for the arrest of the prisoner and detaining him, a very different question arises, and in such a case, the legality of the restraint, in our opinion, cannot be inquired into on habeas corpus.
The respondent, under such circumstances, holds the office under cobr of right, and though not an officer de jure, his right to hold it will not be inquired into in this proceeding, but a direct proceeding should be instituted to first determine the legality of the holding.
It is claimed in the petition that one Absalom Morris was elected to said office, so declared, and that he and not respondent is the real and actual mayor of said city. With this statement, it is but too manifest that the object of this proceeding in effect is to contest the right of Leas to said office, or to convert this writ into a contested election proceeding. That the investigation may stop short of an inquiry into all of the facts attending said election, whether the one or the other received a majority of the legal votes cast at the election, whether the canvassers erred in granting the certificate of election to respondent rather than his competitor, cannot affect the question; for, after all the purpose and object of this proceeding is the same, and such inquiry we do not feel authorized to make. If decided either way, no right would be settled between the real contestants. We can do no more than say that this prisoner is or is not illegally detained. The very nature and framework of the writ shows that this is its sole office, and that it cannot be converted into process under which the rights of parties to official position can be settled and determined. Our statutes provide other and more direct, and well understood and settled methods for determining such controversy.
None of the cases cited by the petitioner relate to a proceeding of this character, nor does any of them' hold *372that the officer may not, in such a case, justify, when he is in the actual discharge of the duties of the office, under color of right, or an election or appointment, while the following cases clearly support the foregoing views, and warrant us in overruling the demurrer. Ex parte Walker, 3 B. Monr., 166; Wilcox v. South, 5 Wend., 235; Aulamier v. The Governor, 1 Texas, 653; Douglass v. Wicklie, 19 Conn., 489.
Friday, June 17. After the demurrer to the answer was overruled, for the reasons stated in the opinion of Wright, Ch. J., the petitioner filed a replication, in which he set out in substance that the certificate under which the respondent claimed to exercise the duties of the office of mayor was false and fraudulent, and alleged that Absalom Morris, and not the respondent, was the mayor of the city. The parties admitted that there was an election regularly held in the city of Des Moines for city officers in March, 1864, that Leas and Morris were, respectively, candidates for the office of mayor at such election; that returns were made and canvassed, as required by section 1131 of the Revision of 1860, showing in Morris’ favor a majority over Leas of five votes, and the result was entered of record; but the recorder or clerk did not deliver any certificate to Morris, being by the city council instructed to withhold the same. Leas gave notice of his intention to contest the election; and such proceedings were had before the city council (Morris all the time protesting against their jurisdiction to act as a contesting tribunal), that it was decided that Leas was elected by a majority of legal votes cast; and a certificate of election was issued to him by the recorder. He thereupon gave bond, and took the oath of office, and has ever since exercised the duties pertaining thereto. Soon after the canvass was made, showing Morris to have a majority; and before the contest was determined, Morris tendered to the council a sufficient bond, with a written oath of office. This bond was referred to the city solicitor by the council, who reported it to be in due form, but with a recommendation, to the effect that no proceedings should be taken in relation to the bond of either party, until the determination of the contest. It was never returned to Morris. Morris has never entered upon or exercised the duties of the office; nor was his right to do so ever recognized by the city council. The other facts appear in the opinion of Wright, Ch. J., and in the following opinion. The only question is, whether Colbert Strahl, the petitioner for the writ of habeas corpus, is entitled in law to be thereon discharged.*372Demurrer overruled.
M. D. McHenry and William, Phillips for the relator, contended: 1. That the general incorporation law conferred no power upon the city council to entertain a contest of an election of mayor. Bev., 1860, ch. 51; Ang. & A. Corp., § 325; 2 Kent’s Com., 298; chap. 25, Acts Extra Sess., 9 Gren. Assembly; 2. That if the certificate of the canvassers, appended to a statement of the result of the canvass, showed that a person other than the respondent, received a majority of the votes cast at the election, the illegality of any ballot cast could be determined only on quo warranto. Bev., 1860, §§ 3732-3739; The People, ex rel. Eastman, v. Seaman, 5 Denio, 409; The People, ex rel. Benton, v. Vail, 20 Wend., 12; The People, ex rel. Welch, jr., v. Ooolc, 4 Seld., 67; 3. The respondent must show that he is an officer de jure, when he is a party and seeks to justify as such. Blalce v. Sturtevant, 12 N. H., 567; 3 Scam. 111., 483; 23 Wend., 490; 5 Id., 235; 5 Hill, 168. If the council did not have authority, its action was void and did not give the respondent even color of authority. Riddle v. Bed-ford., 7 Serg. & R., 386; Green v. Bucle, 23 Wend., 503; Keys v. McKisson, 2 Rawle, 139; Fowler v. Beebe, 9 Mass., 231. O. 0. Nourse, Attorney-General, and R. G. Orioig for the for the respondent. Dillon, J.It is admitted in this case, that if the city council had the legal power or right to entertain and determine the contest between Leas and Morris, who were the competing candidates for the office of mayor, and which decided in favor of the former, and awarded him the certificate, that then he is mayor de jure, and per consequence that the writ of habeas corpus will not lie.
Although we might decide the case upon other grounds, yet as this question is legitimately presented, and has been ably argued at bar, it is proper to notice it, and it will perhaps be much more satisfactory to counsel and the parties interested, that we shall do so, rather than to rest the decision entirely upon the technical grounds peculiar to the writ of habeas corpus.
Under the city charter of January 28th, 1857, section 4, it is clear that the mayor was a member of the city council. It was expressly provided in said section, that the city council “ shall be the judges of the election returns and qualifications of their own members."
Under this charter, the city council, some years ago, passed an ordinance, section 9, whereof is as follows: “ The election of any city officer may be contested by any elector of the city, and the proceedings shall be in accordance with the 30th chapter of the Code of Iowa [being chapter 37 of the Revision], regulating the mode of contesting county officers, so far as the same may be applicable, provided the city council shall be the tribunal before which such contest shall be had, whose decision shall be final.”
*375As every city corporation has the incidental or implied power to pass all ordinances, needful or requisite, to carry into effect and make operative the power which is conferred upon it by its charter, it is clear that the city, under the provision of the charter above quoted, had authority to pass this by-law or ordinance, regulating the mode and prescribing the manner in which they should exercise their power as “judges of the election returns and qualifications of their own members.” A. & A. on Corp., § 325.
Such an ordinance, so far from being in contravention. of the law, or inconsistent with the charter, is plainly authorized and obviously convenient, if not necessary, to make available the grant of power authorizing the council to act as the contesting tribunal. Id., § 343.
It prescribed simply the rules by which they will regulate their action.
The power to pass such an ordinance is not taken away by section 14 of the charter, which confers upon the council authority to make and establish by-laws and ordinances in certain specified cases. This section does not expressly forbid the passage of ordinances in any other cases, nor can it justly be construed to exclude or forbid, by implication, the right to pass ordinances to carry into effect plain and distinct grants, of power with reference to other subjects. A. & Ames, §§ 325, 326, 343, 415, the last of which is pointedly applicable.
We conclude, then, that this ordinance was rightfully passed under the charter of 1857.
But afterwards, under authority from the Legislature (Laws of 1862, p. 24, §§ 6 and 7), this charter was abandoned, and Des Moines organized as a city of the second class, under the general incorporation act. Rev., ch. 51. This act (§ 1140) provided that “ all laws, ordinances and resolutions heretofore lawfully passed and adopted by the city council shall be, remain and continue in force until *376altered or repealed by tbe city council established by this act” As the ordinance in question was lawfully passed, and as it contains nothing inconsistent with any of the provisions of chapter 51 of the Revision, it is expressly continued in force, and has never been altered or repealed. By looking at the broad grant of power, in relation to bylaws and ordinances conferred by section 1071, and the duties of the mayor (§§ 1090, 1091), it will be seen that this ordinance is entirely, consistent with, and applicable to, the city under its new orgaization.
But, aside from this view of the matter, there is another that ought not to be omitted. Section 1093 of the Revision makes the city council “judges of the election returns and qualifications of their own members.” What does this language mean ? It does not mean that the council a*e to canvass the returns of the election, for a different mode is specifically provided by another section (§ 1131). It must either have no effect or else it must mean that they may go behind the returns and judge of or decide questions which may arise in respect to these returns. That they can do so with respect to members of the city council proper is clear, and, indeed, is not disputed. And here two questions arise: 1st. Is the mayor a member of the council, within the meaning of the section ? 2d. May the city council judge of the election returns for all city officers, including mayor, or are they only judges of those returns as respects their own members ?
We see no reason why the latter or limited construction should be given.
There are many good reasons in favor of the other interpretation. Two members are elected for each ward. The mayor may preside in the council. If there is a tie he may give the casting vote. In the council, when presiding, he is essentially a member of it. Out of the council his duties are chiefly executive and judicial. The general laws pro*377vide for no contest of elections to municipal offices. They provide a tribunal for contesting all State, county and township officers, from governor to constable, but they leave each town or city to settle its own contest.
It is highly essential that such a power shall reside in and be exercised by each 'municipality. If the council does not possess it, it does not exist. Influenced by these considerations, and keeping in view the ordinance and the broad language by which it is continued in force, and freely admitting that the question is not free from doubt, we are inclined to hold that the council did not exceed its power in entertaining and determining the contest in question.
And here we might conclude, were it not that the inference might then be drawn that we admit that the right of the respondent to exercise the duties of his office, might, under these circumstances, be inquired into on habeas corpus.
Facts show that there was an election authorized by law; that Morris and Leas were rival candidates; that the canvassers declared in favor of Morris; that Leas contested his right; that the council decided in his favor, and ordered the clerk to make him the proper certificate, which was done; whereupon he took the oath and seal of office, and is exercising its functions, and is the only person who is acting as mayor. That the council acted fraudulently, as alleged, has not been proved. There is no evidence, whatever, which leads us to suppose that they did not act in good faith.
If we are mistaken in supposing that the council had the power to decide the contest between Morris and Leas, still, on the admitted facts in this case, we are not mistaken in holding that Leas was at least an officer defacto, and not a mere usurper.
An usurper is one who intrudes into or undertakes to exercise the duties of an office without any claim or color of right. An officer de jure is one who has a complete legal *378title to his office, as against the world; an officer de facto is one who comes in by the forms of an election or appointment, and who thus acts under claim and color of right,, but who, in consequence of some informality, omission or want of qualification, could not hold his office, if his right was tried in a direct proceeding by an information in the nature of a quo warranto. Aulamier v. The Governor, 1 Texas, 653; Pritchett v. The People, 1 Gillm., 529; McGregor v. Batch, 14 Verm., 29; Tucker v. Aiken, 7 N. H., 113.
If a mere usurper, without color of right, should undertake to confine or imprison a person, the legality of the restraint could be inquired into on habeas corpus; but not so when the officer is one de facto. The statute provides the mode for testing the title of an officer to his office. Rev., ch. 151.
And this is the only appropriate way in which it can be done. To allow every person arrested to try on habeas corpus the question with the officer whether he has an unimpeachable de jure title, whether he was duly elected, whether his certificate or commission is fraudulent, though coming from the proper authority, or to make it the means of settling contesting elections, would be to give to this writ a function and an office wholly unheard of; one which, from its very nature, it is not calculated to perform, and to embarrass and defeat the course of public justice.
We have examined Hurd on Habeas Corpus and other authorities, and have failed to find any case, nor has the petitioner’s counsel produced any, where the title of an officer, whether dejure or de facto, has been tested and determined on habeas corpus.
This strengthens the conclusion in which we all unite, and in relation to which there can be no reasonable ground for doubt, that the petitioner is not entitled to be discharged on habeas corpus, for the reason that the respondent is beyond all dispute an officer defacto, if not dejüre.
Petitioner remanded without costs.