Plaintiff instituted the above-entitled action seeking to recover from defendant the salary paid to said defend*635ant, as municipal judge of the city of 'Sioux Falls in this state, for the term beginning May 2, 1923, and1 ending May 2, 1927. Defendant demurred to the complaint upon the ground:, among others, that the same did not state facts sufficient to constitute a cause of action, and, from an order sustaining said demurrer to the complaint, plaintiff has now appealed.
The action is -purely a personal one for money had and received. Facts material to a determination of the correctness of the conclusion reached by the learned trial judge are, in substance, these:
At an election held April 17, 1923, there were four candidates for the office in question and at that election appellant and respondent received the highest number of votes, appellant receiving 1,813 votes and respondent receiving 1,642 votes, but neither receiving a majority of all votes cast. Thereupon a secondary election was held April 24, 1923, pursuant to section 6328, R. C. 1919, at which appellant and respondent were the sole candidates, and in which election appellant received 3,325 votes and respondent 3,952 votes. Thereupon the governing body of the city declared respondent duly elected to said office for the term of four years, from May 2, 1923, to May 2, 1927, and issued a certificate of election to respondent, and respondent took possession of said office, performed all the functions thereof, and received the salary thereof for said four-year period.
On April 19, 1927, an election was held in the city of Sioux Falls for the same office for the four-year period May 2, 1927, to May 2, 193-1, at which election there were five candidates, respondent, Gibbs, being high with 1,824 votes, and appellant, Bergh, being second with 1,140 votes, but neither receiving a majority of all votes cast. Again a secondary election was held pursuant to section 6328, R. C. 1919, in which secondary election eppellant Bergh received 3,097 votes and respondent Gibbs received 3,041 votes. Thereupon appellant Bergh was issued a certificate of election and took possession of the office, but respondent Gibbs immediately took the position that the secondary election of 1927 was void, and that he had been duly and legally elected at the first election of 1927. He tendered his oath of office and official bond, demanded his certificate of election, and promptly instituted proceedings to test the validity of the secondary election of 1927, as a result of *636which it was determined by this court (Gibbs v. Bergh, 51 S. D. 432, 214 N. W. 838) that section 6328, R. C. 1919, cannot, under the constitution of this state, apply to elections for the office of municipal judge, and this court sustained the position maintained by the present respondent, Gibbs, in that litigation, to the effect that he had been regularly and lawfully elected to the office in question for the term 1927-1931 at the first or regular election held April 19, 1927.
The opinion in that case was filed July 9, 1927, and thereafter and on October 25, 1927, the present proceeding was instituted as aforesaid.
It is the theory of the present complaint that, inasmuch as it has now been determined by this court that section 6328, R. C. 1919, cannot constitutionally apply to the election of municipal judges, it therefore follows that the secondary election in 1923 was void (as this court specifically declared was the case with reference to the secondary election of 1927), and that the first or regular election in 1923 resulted in the election of appellant to the office in question for the term 1923-1927 (pursuant to the same theory on which this court held in Gibbs v. Bergh, supra, that the first or regular election in 1927 resulted in the election of Gibbs to the office in question for the period 1927-193.1).
This theory of the complaint is set out in paragraph 7 thereof in the following language: ‘‘That at the said election held in the City of Sioux Falls, on the 17th of April, 1923, the plaintiff was duly and'legally elected Municipal Judge of the City of Sioux Falls, but that the City Commissioners illegally and wrongdully issued to said Gibbs a certificate of election, and the said Gibbs thereupon took possession of said office and served as Municipal Judge thereof continuously from May 2, 1923, to May 2, 1927, and did receive all the salary and emoluments of said office and did at all of the times between said dates discharge the duties of Judge of said Court; all of which was contrary to law; and that the said Gibbs was not the legally elected Judge of said Court for said period, and that he illegally and unlawfully usurped the said office and held the same contrary to law; that section 6328 of the Rev. Code of ;S. D. 1919 is unconstitutional, illegal and. void; andi that plaintiff, the said Martin Bergh, was legally elected at the election held *637on the 17th of April, 1923, and was at all times entitled to the said office and all of the salary and perquisites thereof.”
It appears from the allegations of the complaint, however that the secondary election in 1923 was treated by all concerned as valid and lawful. The governing body of the city recognized it as lawful and issued a certificate of election to respondent, Gibbs. He entered' peacefully into possession of the office and exercised its functions and received the salary thereof for the full term of four years without, so far as the complaint shows, any objection being* raised in any manner by anyone at any time. Under those circumstances, respondent, Gibbs, was more than a mere intruder or usurper. He was openly and notoriously in possession of the office, exercising all the functions thereof, and receiving all the emoluments thereof under claim of right and with color of title thereto in the form of his certificate of election. According to some of the authorities, under such circumstances, conceding that the election upon which the rights and claims of respondent, Gibbs, were founded was held under an unconstitutional statute, nevertheless, after the expiration of the period when such election could' be contested, respondent, Gibbs, would be a de jure officer and secure in his position for the full term of office. See State ex rel. Windom v. Prince, 131 Minn. 399, 155 N. W. 628. In any event, and upon all the authorities, during the full four-year term in question, respondent, Gibbs, was at the very least a de facto officer in possession of the office and exercising all the functions thereof under claim of right and color of title thereto. Conceding, without deciding, that appellant Bergh might institute an action to recover from respondent, Gibbs, the salary in question without first having secured a judicial determination that his own right and title to' the office were superior to the claim of right, color of title,- and de facto exercise thereof by respondent, Gibbs, certainly he cannot hope to prevail in such action unless his complaint therein alleges facts from which such superior right and title on his part may be determined as a matter of law.
When we examine the complaint in the instant case it is plain that the only allegation thereof tending to establish in appellant any title to the office during the period in question is the allegation that the secondary election in 1923 under which respondent Gibbs claimed and exercised the office for the full four-year term was *638unconstitutional and void, and “that plaintiff, the said) Martin Bergh, was legally elected at the election held on the 17th of April, 1923, and was at all times entitled to the said office and all of the salary and perquisites thereof.”
This is not sufficient. A candidate does not establish title to an office, good as against some other person who is in possession of the office and exercising the functions thereof under claim of right and color of title thereto, merely by appointment or election, in cases such as the present where the statute affirmatively prescribes how and when an officer, after his election or appointment, shall qualify. Just what is sufficient in that regard we d'o not here undertake to say, and we need not attempt to> decide with precision or for universal application in this case. But at least this much may safely be stated as being beyond question, that the appointment or election must be followed, either by entry into the office and assuming the functions thereof, or by qualifying therefor in the manner and at the time prescribed 'by law, or by a good-faith effort so to qualify. Whether qualification in the manner prescribed by statute is always a prerequisite, or whether under some circumstances (and, if so, under what circumstances) its place may be taken by entering into, possession of the offi'ce and exercising the functions thereof, or by a good-faith, but ineffectual, attempt or effort to qualify, are questions which are not presented and do not require consideration in this case. Appellant in his complaint has not alleged that he did any of those things. He has not alleged any facts from which it may be held to appear that he in any manner made any attempt to perfect title to the office (claim to which he might perhaps have based upon the first or regular election in 1923, if he had acted properly and promptly thereafter), nor has he alleged any facts from which it may be held, as a matter of law, that he had any sort of title to the office in question during the term 1923-1927 superior to the claimed, recognized, and exercised rig'ht and. title of the respondent, Gibbs, even though the validity of the respondent’s claims would have been open to question, if properly and promptly attacked.
Appellant having made no effort ■ to establish or perfect at any time any rights with relation to the office in question which he might have been able to establish by virtue of the first election in 1923, and having shown no title to the office in himself, and having. *639acquiesced in the possession and performance of the office by respondent, Gibbs, during the full four-year period of the term thereof, is not now in position successfully to maintain that respondent, Gibbs, has received the salary of said office during said four-year term, or any part thereof, to the use or for the benefit of appellant.
The learned trial judge ruled the matter correctly upon the demurrer, and his order is affirmed.
PULLEY, P. J., and BiURCH, BROWN, and ROBERTS, JJ., concur.