The county attorney or the assistant county attorney shall be allowed at all times to appear before the grand jury for the purpose of giving information relative to any matter cognizable by such jury, or giving such jury advice upon any legal matter the jury may require, and such county attorney or assistant county attorney may interrogate witnesses before the jury when the grand jurors, the county attorney, or the assistant county attorney shall deem it necessary; except that no person shall be permitted to remain in the room with such jury while the grand jurors are expressing their views or giving their votes on any matter before the jury; Provided, whenever it shall be made to appear to the judge or judges of the district court that investigation should be made regarding official acts of county officials, the foreman shall forthwith notify the Governor of the state, who shall forthwith appoint a special prosecutor to appear and act in the place of the county attorney or the assistant county attorney in all matters relating thereto before such grand jury in like manner as though county attorney; and the county attorney or the assistant county attorney shall be excluded from the presence of the grand jury during all proceedings which relate to the subject matter for which the special prosecutor was appointed; except that nothing in this section shall prevent the county attorney or assistant county attorney from appearing as a witness before a grand jury for which a special prosecutor has been appointed.