
456 P.2d 443 (1969)
P. Michael MARFISI, Attorney at law, of the firm of Vaughan, Hull, McDaniel & Marfisi, Petitioner,
v.
FOURTH JUDICIAL DISTRICT COURT of the State of Nevada and the Honorable George F. Wright, Judge thereof, Respondents.
No. 5899.
Supreme Court of Nevada.
July 11, 1969.
Vaughan, Hull, McDaniel & Marfisi, Elko, for petitioner.
Mark C. Scott, Jr., Dist. Atty., Elko, for respondents.

OPINION
BATJER, Justice.
The petitioner, P. Michael Marfisi, seeks a writ of prohibition to prevent the respondent court and judge from proceeding with a criminal action on the ground that 1969 Statutes of Nevada, Chapter 251, precludes the petitioner, who is the assistant city attorney of the city of Elko, Nevada, from continuing to defend Leon Harley Anderson, an indigent, charged with the crime of murder.
Marfisi was appointed as counsel by the respondent, Judge George F. Wright. Subsequent to Marfisi's appointment and after he had represented the defendant at the preliminary hearing and at his arraignment, the Nevada Legislature enacted Chapter 251, Statutes of Nevada[1], which became effective April 8, 1969. This statute prohibits persons in Marfisi's position from participating in the defense of criminal cases.
Upon the grounds that he could no longer qualify to serve as the appointed attorney for Anderson, because of the enactment of Chapter 251, 1969 Statutes of Nevada, Marfisi moved the district court for permission to withdraw as counsel. On April 30, 1969, his motion was heard and denied.
Reyling on State ex rel. Watson v. Merialdo, 70 Nev. 322, 268 P.2d 922 (1954); Board of Co. Commissioners of Washoe County v. Devine, 72 Nev. 57, 294 P.2d 366 (1956); and In re Watson, 71 Nev. 227, 286 P.2d 254, 53 A.L.R.2d 301 (1955), the trial judge said: "To interpret the bill [statute] as applying to a pending case where the Court had appointed qualified attorneys and hold that the Court must permit the attorneys to withdraw, would be a clear interference with the Courts, justice, and the rights of the defendant to be adequately represented and unconstitutional." The cases relied upon by the respondent all involved legislative interference with an inherent judicial power. We are not here concerned with any legislative interference with the inherent power of the courts. While the courts have the inherent power to declare what shall constitute the practice of law and which persons shall be admitted to practice before the courts, it is within the exclusive power of the legislature to create the office of city attorney and to limit the duties and responsibilities of the holder of that office.
Article 4, Sec. 25 of the Nevada Constitution provides that the legislature shall establish a system of county and township government which shall be uniform throughout the state. This the legislature has done in NRS Chapters 265 through 273. Specifically, NRS 266.465 through 266.475, sets out the qualifications and duties of a city attorney. Inasmuch as the constitution has given the legislature a mandate to establish governments for the towns and cities of this state, we find that the enactment of Chapter 251, 1969 Statutes of Nevada is a valid exercise of that mandate and not an interference with the courts.
Although in Callahan v. Jones, 200 Wash. 241, 93 P.2d 326, 123 A.L.R. 1178 (1939), the court was concerned with legislative action designed to control the scope of practice which could be pursued by a district attorney, it held that such control was within the realm of legislative power and said: "The legislative intent to entirely separate the official duties of prosecuting attorneys from any private gain clearly appears, and this legislative policy is so clearly in the public interest that the statutes should not be restricted by judicial interpretation, but should be so construed as to accomplish to the full its beneficent purpose."
We find that principle applicable to this case. Chapter 251, 1969 Statutes of Nevada is clearly in the public interest. In County of Madera v. Gendron, 59 Cal.2d 798, 31 Cal. Rptr. 302, 382 P.2d 342, 6 A.L.R.3d 555 (1963) the statutory limitation on the private practice of law by district attorneys was declared to be a proper legislative function.
In Grievance Committee, Etc. v. Dean, 190 S.W.2d 126 (Tex.Civ.App. 1945), the court confronted with the unauthorized practice of law rather than a legislative limitation on the practice of law, held that the judicial department of the state government has the authority to declare what shall constitute the practice of law, but such power is not exclusive, and went on to say: "It is undoubtedly true, however, that the practice of law is a profession affected with a public interest and the Legislature, under its police power, and to protect the public interest, may legislate reasonably to that end. In doing so, it acts in aid of the judiciary and not to the exclusion of, nor in denial of, the constitutional powers of the judicial branch of the government."
We are not concerned with any retroactive application of the statute but only its prospective application as it affects the petitioner. In a criminal case, each time an attorney consults with his client, files any pleadings with a court, or makes any appearance on behalf of his client, he is undertaking the defense of the client, and each separate act is a separate undertaking. From and after April 8, 1969, as long as he was an assistant city attorney, the petitioner was disqualified to act as defense counsel in a criminal case.
The language of the statute under consideration is mandatory. It was incumbent upon the trial court to grant the petitioner his motion to withdraw as appointed counsel, and the denial of that motion was error.
We find Chapter 251, 1969 Statutes of Nevada to be constitutional; grant the petition for a writ of prohibition; and order that the petitioner be permitted to withdraw as appointed defense counsel in the criminal action entitled "The State of Nevada, Plaintiff, vs. Leon Harley Anderson, Defendant, No. 2143, Fourth Judicial District Court of the State of Nevada, in and for the County of Elko."
COLLINS, C.J., and ZENOFF, MOWBRAY and THOMPSON, JJ., concur.
NOTES
[1]  Chapter 251, Statutes of Nevada: "No city attorney, district attorney or attorney general or their deputies and assistants hired or elected to prosecute persons charged with the violation of any ordinance or any law of this state shall, during their terms of office or during the time they are so employed, in any court of this state, accept an appointment to defend, agree to defend or undertake the defense of any person charged with the violation of any ordinance or any law of this state."
