delivered the opinion of the court.
*586In June, 1899, the United States Fidelity and Guaranty Company became surety on the official bond of J. R. Peebles, treasurer of Nelson county, for the faithful performance of his duties as treasurer for his term of office of four years, commencing July 1 of that year. At the January term, 1902, of the County Court of that county, the surety company, having given the treasurer notice thereof, tendered its petition to be relieved as surety on the bond. The treasurer appeared and denied the right of his surety to be relieved, upon the ground that it had for a valuable consideration become his surety on the bond for the full term of his office, 'and was not, therefore, entitled to the relief sought. Upon the hearing, the court, being of opinion that the surety company did not have the right to be relieved, declined to grant the prayer of the petition. The judge of the Circuit Court for that county, having in vacation refused a writ of error to that order, this writ of error was awarded by one of the judges of this court.
The defendant in error insists that if the surety company had, as it claims, the arbitrary right to be relieved as surety on the bond, then its remedy for the refusal of the County Court to grant that relief was by mandamus, and not by writ of error, and that this writ should be dismissed as improvidently awarded.
By section 2887 of the Code, it is provided, among other things, that “when the surety .... of any officer ... required to give bond shall petition the court in which the bond is taken .... to be -relieved from the suretyship, such court shall, on proof of reasonable notice of his intended motion, require such officer . , . to give a new 'bond in the same manner as if none had been given by him.....” ■
It is clear from this section of the Code that a surety upon the official -bond of a treasurer has the absolute right to be relieved from his suretyship, upon petition to the proper court to be so relieved, after reasonable notice to his principal, and that when he has complied with the terms of that section the -court *587must require the principal to give a new bond in the same manner as if none had been given by him. The surety is not required to show cause as a condition precedent to the relief sought, and the court 'has no discretion in the matter. Fo distinction is made by the statute between the rights of one who has received a consideration for becoming surety and one who has assumed that obligation gratuitously. The statute applies to both classes of sureties 'alike, and the courts in construing and enforcing it can make no distinction between them without disregarding the plain and unambiguous language of the statute.
At the time that section was enacted, courts and other tribunals upon whom the duty of taking or approving official bonds was imposed were not authorized to accept surety companies as sureties on such bonds. The authority to do' this was first conferred by an act approved March 5, 1894. Acts of 1893-4, p. 764. That act was amended and re-enacted by an act approved February 6, 1896 (Acts 1895-6, page 284), and confers authority upon the courts, judges and other officers authorized to approve certain bonds (embracing bonds of county treasurers) to accept as surety thereon, upon certain conditions, any company with a paid up cash capital of not less than two hundred and fifty thousand dollars, incorporated and organized under the laws of any State of the United States or foreign county, for the purpose of transacting business as surety on obligations of persons and corporations, and which has complied with all the requirements of law regulating the admission of such companies to transact business in this State.
It further provides that “such surety shall be relieved from its liability on the same terms and conditions as are by law prescribed for the release of individuals1, and have all the rights, remedies 'and reliefs of an individual guarantor, indemnitor, or surety, it being the true intent and meaning of this act to enable corporations created for that purpose to become the surety on bonds required as aforesaid, subject to all the rights and liabilities of private parties.”
*588If only gratuitous sureties could 'be arbitrarily relieved of tbeir suretyship under section 2887 of the Code, the provisions for the release of ¡surety companies was useless. The courts were only authorized to accept such surety companies as were incorporated and organized for the purpose of transacting business as sureties. The Legislature could not have contemplated that such companies would become gratuitous sureties. Indeed, it must have known that such companies could not transact business as sureties without receiving compensation; and by section 2 of the act it authorizes the tribunal which passes upon or settles the accounts of the principiáis in the bonds upon which such companies become sureties, except where the principals are State, county or municipal officers, to allow a reasonable sum for the expenses of securing such surety.
Section 2887 of the Code, as -we have before seen, gives to individual sureties the arbitrary right to be relieved from their suretyship upon filing their petition in the proper court and giving reasonable notice of the motion to be relieved.
It follows that the plaintiff company has the same arbitrary right as an individual or private party to be relieved from it? suretyship by filing its petition for that purpose 'and giving the required notice.
If the act to be performed by the court was a ministerial and not a judicial one, the means of testing the action of the County Court in refusing to relieve the plaintiff company of its surety-ship, is not by writ of error or supersedeas, but by mandamus.
It often happens that duties are devolved upon courts or judges,- either by operation of law or by express statute, which partake more of a ministerial than a judicial nature, and where the duty is so plain 'and imperative that no element of discretion can enter into its performance. While the courts uniformly refuse to interfere with the discretion of inferior tribunals in the performance of their duties, yet as to acts to be performed by a court or judge in a merely ministerial capacity, or'as to *589duties which axe imposed upon them by statute, and as to which there can be no dispute, and no element of discretion, mandamus is the appropriate remedy. High on Extr. Rem., secs. 230, 231; Broaddus v. Supervisors, 99 Va. 370, 372.
In the cases of Dawson v. Thurston, 2 H. & M. 132, and of Manns v. Givens, 7 Leigh, 689, the question involved in each was the refusal of the court to admit a deed to record. The statute provided that, upon proof that the deed was properly executed, the County Court should admit it to record. It was held that if the proof was sufficient to authorize it to be recorded, it was the imperative duty of the court to admit it to record, and for a refusal to do so, mandamus was the proper-remedy.
In the case of Delaney v. Goddin, 12 Gratt. 266, one of the-questions involved was whether the duty imposed by section 15 of chapter 31 of the Code of 1819 (page 203) was judicial or ministerial. The authority of the courts under that section was-limited to the enquiry whether the report of the surveyor was in conformity with the provisions of the section under which the report was made. It was held that the duty imposed upon the-court by that section was ministerial and not judicial, and that a writ of error would not he to the action of the court refusing-to admit the surveyor’s report to record, and that the remedy of the party aggrieved was by mandamus.
The same question arose in the case of Randolph County Justices v. Stalnaker, 13 Gratt. 523, 525, and was decided in the same way. Judge Allen, who delivered the opinion of the court, said: “The principal questions presented by the record have been settled by the decision of this court in the case of Delaney v. Goddin, 12 Gratt. 266. That case was elaborately argued and maturely considered; and all the judges were of opinion that the -authority of the County Court was limited to the enquiry, whether the report of the surveyor is in conformity with the provisions of the section under which it was made; and *590if free from objection in this respect it becomes the imperative duty of the court to order the report to be recorded, and a majority of the court held that in passing on such question the County Court is vested with no judicial power, but acts in a capacity purely ministerial, and that an error in refusing to order the report of the surveyor to be recorded can only be corrected by mandamus.”
In the cases cited the court had to determine whether or not the deeds were properly proved or admowledged, or the report of the surveyor in proper form. In this case, it had to determine whether or not the notice required had been given. In this, as in those cases, if the fact existed which made it the court’s duty to act, it had no discretion in the matter. It was its imperative duty to require the plaintiff to give a new bond.
We are of opinion, therefore, that the remedy of the plaintiff company for testing the correctness of the action of the County Court in refusing to require the defendant to give a new bond, and thereby release the plaintiff company as surety, is not by writ of error, hut by mandamus, and that this writ of error must be dismissed as improvidently awarded.
Dismissed.