This case involves Maryland’s Merit System Law, Maryland Code (1988 Repl.Vol.), Article 64A (the Act) and whether, under its provisions, the Deputy Administrator of the State Administrative Board of Election Laws is a classified or unclassified State employment position.1
I
The “classified service” is defined in § 1 to mean “all offices of profit or trust and all places of employment, *49whether permanent or temporary, in the service of any State ... department, commission, board or institution” other than those in the military forces and those enumerated in § 3. With exceptions not here pertinent, a “classified service employee” is defined in § 1 as a person “who holds under the terms of this article, a position in the classified service.”
The enumeration in § 3 of positions not within the classified service is set forth in seventeen numbered paragraphs; they include, in § 3(13), all positions in State boards, commissions, departments and institutions
“which the Secretary [of Personnel] may determine, with the approval of the Governor, require medical, engineering, scientific, educational or expert training and qualifications.” (Emphasis added.)
Section 4, in twelve numbered paragraphs, delineates additional positions which are not included in the classified service. Other express exclusions from the classified service are contained in §§ 6 and 9V(a) of the Act.2
Numerous sections in the Act expressly include named positions as within the classified service; some of these sections blanket existing positions and their incumbents into the classified service without competitive examination, based on a specified period of prior service in the position. See, e.g., §§ 5, 7, 8, and 8A.3
The Secretary of Personnel is vested with rule-making authority by § 11 in the enforcement of the provisions of *50the Act. The Secretary is directed by § 15, among other things, to determine the nature of all positions in the State service.
Absent express statutory inclusion as a classified service employee, eligibility for such an employment status depends upon the results of a competitive examination administered by the Secretary. From a “list of eligibles” passing the examination, the selection must be made from those five individuals scoring the highest in the competitive examination. §§ 17, 18, and 22.
Under § 33(d), the Secretary is required to prescribe, by rule, “what may constitute causes for removal” from the State service. A classified employee may be removed from his position only for cause, upon written charges, and an opportunity to be heard in his own defense; a broad right of appeal is provided to the terminated employee. COMAR 06.01.01.47 and .61. An unclassified employee may be terminated at will without a showing of cause and his right of appeal “is limited to the legal and constitutional bases for the termination.” COMAR 06.01.01.60 and .62. See Bender v. Sec., Dep’t of Personnel, 290 Md. 345, 351, 430 A.2d 66 (1981).
II
The State Administrative Board of Election Laws (SA-BEL) was created by ch. 555 of the Acts of 1969, now codified as Code (1986 Repl.Vol.), Art. 33, § 1A-1. It assumed functions previously performed by the Secretary of State, including supervision of the conduct of elections within the State to assure compliance with Maryland’s Election Code by the City of Baltimore and County Boards of Supervisors of Elections.4 Art. 33, § 1A-I(e). The Act creating SABEL provided for a State Administrator of *51Election Laws, but neither that Act nor any subsequent legislation made provision for the position of Deputy Administrator. No mention was made in the original or in any subsequent legislation whether SABEL’s employees were classified or unclassified State employees.5
In August 1971, Edwin Billhimer began work at SABEL as State Supervisor of Voting Machines. He did not take a competitive examination for this position, nor was he selected from an “eligible list” of those who had passed such an examination. According to Department of Personnel records Billhimer was given a classification code number of 5421, which indicated that he was an unclassified employee.6 In January 1972 Billhimer took and passed an examination for the position of Election Chief Clerk in the State classified service. This position did not exist within SABEL; it was available only at local boards of supervisors of elections. Billhimer was never selected for this position and thus never served as Election Chief Clerk.
In late 1977 the position of Deputy State Elections Administrator was created within SABEL and Billhimer was promoted into this position. The Department of Personnel code numbers assigned to the new position indicated that it was unclassified. Billhimer remained SABEL’s Deputy Administrator until December 1982. That month he received a letter from SABEL’s State Administrator terminating his employment effective December 31, 1982 and advising him that, under the personnel rules applicable to unclassified employees his right of appeal was limited to an inquiry into whether he was discharged for illegal or unconstitutional reasons.
Contending that he was a classified employee, Billhimer appealed his discharge to the Secretary of Personnel. In *52April 1983 a hearing was held, as authorized by law, before a Department of Personnel arbitrator. By agreement of the parties the sole issue was Billhimer’s classified or unclassified status.
To show that Billhimer was an unclassified employee, SABEL introduced into evidence a draft of a 1976 Department of Personnel Report of Survey; it examined the job descriptions of, and staffing pattern for, the nine permanent positions that, in addition to the State Administrator, then existed at SABEL. The report described Billhimer’s then position of State Supervisor of Voting Machines as “the technical expert in charge of voter registration, ballot layout and arrangement, and voting machines.” The survey team stated in the report that because SABEL lacked a deputy administrator to “take charge of the routine day-today decisions in the Administrator’s absence and ... to assume his responsibilities in the event the Administrator’s position is suddenly vacated,” a serious weakness existed in SABEL’s organizational structure. The survey team urged that a Deputy Administrator position be created at SABEL by augmenting the duties of one of the existing SABEL positions; suggested that the position be filled by someone possessing “either a college degree with considerable administrative experience or someone with considerable experience in the electoral process and proven administrative ability”; and stated that “due to the sensitive nature of such a position, placement in the Unclassified Service is also warranted.”
In addition to the draft report, SABEL introduced into evidence letters from, and internal memoranda of, the Department of Personnel indicating its support for the creation of the new Deputy Administrator position as unclassified and assigning the position an unclassified code number. Further evidence adduced included documents showing the reclassification of Billhimer’s former Supervisor of Voting Machines position into the new Deputy Administrator position and Billhimer’s promotion into the new position. Bill*53himer introduced no evidence beyond the letter notifying him of his termination.
In her Proposal for Decision issued in February 1984, the arbitrator, in five proposed findings of fact, summarized the foregoing evidence presented by SABEL. In her proposed conclusions of law, the arbitrator, after quoting from §§ 1 and 3(13) of the Act, stated: “Clearly, the Deputy Administrator position is one requiring definite and specific expertise.” The arbitrator concluded that “Mr. Billhimer never has been and, at the time of his termination was not, a classified employee. At the time of his appointment he accepted the benefits of unclassified status by not having to compete for the position under Merit System procedures. He cannot now, at his termination, rightly claim the protections of the Merit System in seeking to overturn his discharge.”
In March 1984 the arbitrator’s proposed findings of fact and conclusions of law were adopted by the Director of the Employer-Employee Relations Division. The Director denied Billhimer’s request to present two documents that had not been presented at the hearing. Billhimer’s case was thereafter set for a hearing and restricted to the legal and constitutional bases for his termination. Prior to the hearing, Billhimer informed the Secretary that he knew of no illegal or unconstitutional bases for the discharge. No hearing, therefore, was held, and in June 1984 the Secretary, accepting the findings of the arbitrator, issued an order separating Billhimer from SABEL effective December 31, 1982.
Billhimer appealed to the Circuit Court for Anne Arundel County and moved for leave to present additional evidence. The court (Cawood, J.) granted the motion, and in May 1985 remanded the case to the Department of Personnel to receive additional evidence, retaining jurisdiction to decide the substantive issues after the additional evidence had been obtained. In July 1985 the arbitrator received into evidence from Billhimer a SABEL organization chart and a letter reporting that in January 1972 Billhimer had taken *54and passed a Department of Personnel examination for the position of Election Chief Clerk. Testifying at this hearing, Billhimer acknowledged that the Election Chief Clerk position existed only at local boards of supervisors of elections and not at SABEL, and that he never held the position; he stated, however, that, as a SABEL employee, on several occasions he worked temporarily at the local boards, performing duties comparable to those of the Chief Election Clerks in those offices.
The arbitrator also received additional evidence from SA-BEL, i.e., Department of Personnel records showing that at all times during Billhimer’s employment at SABEL the code numbers assigned to his position indicated merit system exemption; a document explaining the meaning of the classification code numbers; a memo from Robin J. Zee, then the Department’s Director of Classification and Compensation, pertaining to contact between the Secretary and the Governor’s Office with regard to SABEL; and documents showing that SABEL’s request for the creation of the Deputy Administrator position was presented to the State Board of Public Works and was approved after discussion.
The Zee memorandum was dated December 3, 1969; it stated
“Commissioner [Secretary] Bosz contacted the Governor’s Office and it is their intention that all positions in this agency should be exempt. It was felt that the' legislation creating this agency intended that this be so even though it wasn’t specifically stated. Part of the functions for the new agency were formerly performed by the Secretary of State’s Office. There is a feeling that this new agency is directly tied to the Executive Department which is exempt from the Merit. System. The Governor had promised the new Administrator that he could employ any person he desired.”
The document from the Board of Public Works was dated December 16, 1977. Then Acting Governor Lee, Comptroller Goldstein, and Treasurer James were members of the Board at that time. The document stated, in relevant part, *55that there was an emergency need to approve “the establishment of a new classification of Deputy State Election Administrator” at SABEL; that a Department of Personnel survey of SABEL indicated that “a serious weakness in organizational structure existed without a Deputy Administrator”; and that this position would “allow someone full authority to take charge of routine day-to-day decisions in the Administrator’s absence and to assume his responsibilities in the event the Administrator’s position is suddenly vacated for any reason.” The document further noted that the request had been initiated by the Department of Personnel, had been reviewed by the Department of Budget and Fiscal Planning, and approval was recommended. Prior to approving the new position, the Board members were told that it was not an additional position at SABEL but rather a new classification.
Upon this additional evidence, the arbitrator, in January 1986, found that throughout Billhimer’s employment at SABEL his classification code numbers indicated merit system exemption and that the Governor’s office in 1969 expressed its intention that all SABEL positions be unclassified. “Nothing presented at the July 1, 1985 hearing,” the arbitrator said, “has caused me to alter the conclusions reached in my February 22, 1984 decision.”
The case returned to the circuit court. That court held that Billhimer had shown, as a matter of law, that his position had not been exempted from the classified service. In reversing the Secretary, the court reasoned that § 3(13) of the Act required four criteria or elements to establish exemption from the classified service, i.e.:
“1. There must be a State position.
2. The Secretary of Personnel must determine that the position requires medical, engineering, scientific, educational or expert training and qualifications and should be unclassified.
3. The Governor must concur in that approval.
4. There must be at least- some indication that such training and qualifications are required; in other words, *56this cannot be used as a subterfuge to defeat the system.”
According to the court, the evidence before the arbitrator failed to establish the second and third elements. The only evidence probative of these elements, the court said, was the Zee memorandum which failed to show that the Secretary ever determined that Billhimer’s position required “medical, engineering, scientific, educational or expert training and qualifications,” or that the Governor ever approved that determination. The reasons advanced for treating SABEL’s employees as unclassified, the court said, did not satisfy § 3(13)’s statutory requirements.
The court also rejected the argument that Billhimer’s classification code numbers established that he was in an unclassified position. Quoting Henslee v. State Personnel Board of Review, 239 N.E.2d 121, 123, 15 Ohio App.2d 84 (1968), the court stated: “The fact that a position is carried on the auditor’s payroll as being in the unclassified service does not establish that classification.” Also unconvincing to the circuit court was SABEL’s contention that because Billhimer accepted the benefits of unclassified status by not passing a competitive examination for his position, he could not now claim classified status. To accept this argument, according to the trial court, “would mean that the executive branch could place any person in the unclassified service, however illegally or haphazardly, inform them of the same, and then, in effect, deprive them of the benefits of the classified service.” The court remanded the case for a hearing on the merits of Billhimer’s termination.
SABEL appealed to the Court of Special Appeals, which affirmed the judgment of the circuit court. State Election Bd. v. Billhimer, 72 Md.App. 578, 531 A.2d 1298 (1987). The intermediate appellate court, stating that the trial court reversed the agency as a matter of law and not on the basis of the agency’s factual findings, held that that court had correctly concluded that the agency misconstrued and misapplied the law. It first noted that the legislature, in 1971, amended both the Act (§ 9G) and the Election Code (Art. 33, *57§ 2-6) “to place all continuously employed permanent employees of the boards of supervisors of elections in the various subdivisions of the State in the State’s classified service” under the jurisdiction of the Secretary of Personnel. 72 Md.App. at 584, 531 A.2d 1298. While the intermediate appellate court recognized that these amendments did not explicitly place SABEL employees in the classified service, it said that neither did they “expressly exempt the SABEL staff from the classified service.” Id. Building upon this premise, the court reasoned that the statutory language of § 1 of the Act was clear and unambiguous, namely, that all employees of the state are deémed classified unless specifically exempted. Id. at 586, 531 A.2d 1298. The only specific exemption applicable to SABEL’s employees, in the court’s view, was that provided by § 3(13) of the Act. According to the court, however, the findings on which the Secretary grounded his decision did not show that either Billhimer’s original position or his subsequent Deputy Administrator position had ever been properly exempted in accordance with § 3(13)’s requirements. The survey team draft report was not sufficient to establish any of § 3(13)’s elements, the court stated, because it was not a finding relied upon by the arbitrator and, in any case, it did not explicitly find that the Deputy Administrator position requires “medical, engineering, scientific, educational or expert training and qualifications.” Id. at 588, 531 A.2d 1298. The intermediate appellate court further found that the Zee memorandum was also deficient as there was no indication in it that the SABEL employees were to be exempted for the reasons required by § 3(13). The court also rejected SABEL’s other arguments, in particular, its contention that Billhimer’s personnel classification code numbers proved his unclassified status. This finding, it said, rested on a spurious theory of “bureaucratic osmosis, i.e., a gradual absorption into an unclassified status by virtue of misidentification.” Id. at 591, 531 A.2d 1298. We granted certiorari to consider the significant issue raised in the case.
*58Ill
The standard and scope of review of the Secretary’s decision is set forth in the Maryland Administrative Procedure Act, Code (1984) § 10-215 of the State Government Article. Subsection (g)(3) provides that a reviewing court may
“reverse or modify the decision [of the agency] if any substantial right of the petitioner may have been prejudiced because a finding, conclusion, or decision of the agency:
(i) is unconstitutional;
(ii) exceeds the statutory authority or jurisdiction of the agency;
(iii) results from an unlawful procedure;
(iv) is affected by any other error of law;
(v) is unsupported by competent, material, and substantial evidence in light of the entire record as submitted; or
(vi) is arbitrary or capricious.”
In determining whether an agency’s decision is supported by substantial evidence, we are mindful that substantial evidence is “such relevant evidence as a reasonable mind might accept as adequate to support a conclusion.” Supervisor v. Group Health Ass’n, 308 Md. 151, 159, 517 A.2d 1076 (1986); Bulluck v. Pelham Woods Apartments, 283 Md. 505, 512-13, 390 A.2d 1119 (1978); Snowden v. Mayor & C.C. of Balto., 224 Md. 443, 448, 168, A.2d 390 (1961). In applying the substantial evidence test, we must not substitute our judgment for the expertise of the agency, Supervisor of Assessments of Montgomery County v. Asbury Methodist Home, Inc., 313 Md. 614, 547 A.2d 190 (1988); Motor Vehicle Admin. v. Lindsay, 309 Md. 557, 564, 525 A.2d 1051 (1987); Group Health Ass’n, supra, 308 Md. at 159, 517 A.2d 1076; Bernstein v. Real Estate Comm., 221 Md. 221, 230, 156 A.2d 657 (1959), appeal dismissed, 363 U.S. 419, 80 S.Ct. 1257, 4 L.Ed.2d 1515 (1960), for the test is a deferential one, requiring “restrained and disciplined judicial judgment so as not to *59interfere with the agency’s factual conclusions,” Asbury Methodist, supra, 313 Md. at 625, 547 A.2d 190; Insurance Comm’r v. Nat’l Bureau, 248 Md. 292, 309-10, 236 A.2d 282 (1967). This deference applies not only to agency fact-finding, but to the drawing of inferences from the facts as well. St. Leonard Shores Joint Ven. v. Supervisor, 307 Md. 441, 447, 514 A.2d 1215 (1986); Bulluck, supra, 283 Md. at 513, 390 A.2d 1119; Snowden, supra, 224 Md. at 448, 168 A.2d 390. When, however, the agency’s decision is predicated solely on an error of law, no deference is appropriate and the reviewing court may substitute its judgment for that of the agency. Washington Nat’l Arena v. Comptroller, 308 Md. 370, 378-79, 519 A.2d 1277 (1987); Ramsay, Scarlett & Co. v. Comptroller, 302 Md. 825, 490 A.2d 1296 (1985). In brief, so long as the agency’s decision is not predicated solely on an error of law, we will not overturn it if a reasoning mind could reasonably have reached the conclusion reached by the agency.
(A)
We do not share the view of the circuit court and Court of Special Appeals that the arbitrator misconstrued and misapplied the law. As the arbitrator correctly stated, the law controlling this case is contained in §§ 1 and 3(13) of Article 64A. While the circuit court’s analysis of § 3(13) into four component elements is of considerable aid, it does not compel the conclusion that the arbitrator erred in her interpretation and application of that section. Indeed, the arbitrator identified the controlling law, stated it accurately, and contravened no canons of statutory construction or expressions of legislative intent in construing it.
Nor do we think that the arbitrator incorrectly applied the provisions of § 1 of the Act by failing to conclude, in the circumstances of this case (as did the Court of Special Appeals), that Billhimer was a classified employee simply because his position was not specifically exempted from the classified service. A “classified service employee,” as we earlier observed, is defined in § 1 of the Act as a *60person “who holds [a classified position] under the terms of this, article.” That Billhimer did not achieve his position through the competitive examination process, as required by the Act’s terms, or through compliance with a statutory provision, is clear from the record. Thus, to determine as a matter of law that Billhimer was a classified employee totally ignores the uncontradicted evidence that he never qualified for this status “under the terms of this article.” Moreover, the intermediate appellate court was wrong in placing any reliance upon the provisions of § 9G of the Act; that statute relates solely to the local boards of supervisors of elections and has no application to the employment status of SABEL employees.
We thus find that no error of law affected the Secretary’s decision.
(B)
In determining whether the Secretary’s decision was supported by substantial evidence, it is well to distinguish two issues that have become somewhat intertwined in the treatment accorded them below. The first is whether Billhimer occupied an unclassified position when he began work for SABEL in 1971 as State Supervisor of Voting Machines. The second is whether the position Billhimer occupied from 1978 to 1982 as Deputy Administrator was unclassified. The second issue is, of course, the decisive one. We think there was substantial evidence to support the Secretary’s determination that when occupying the Deputy Administrator position Billhimer was an unclassified employee.
The four elements required for exemption by § 3(13), as the circuit court correctly stated, are: the existence of a State position; the Secretary’s determination that the position requires medical, engineering, scientific, educational, or expert training and qualifications; the Governor’s approval of the Secretary’s determination; and a showing, applicable here, that the position is one requiring “expert training and qualifications.”
*61The first element is not at issue. The fourth element was adequately established, we think, by the draft survey report and the December 1981 questionnaire describing the Deputy Administrator’s duties. Both of these documents indicated that the Deputy Administrator’s responsibilities required a broad knowledge of the electoral process, as well as the expertise needed to assume the functions of the Administrator, if necessary. This was substantially equivalent to stating that the position required expert training and qualifications within the contemplation of § 3(13).
The second element was established by the evidence showing that the Secretary, in recommending the creation of the Deputy Administrator position, adopted the findings of the Department’s survey report. Evidence probative here included a November 1977 letter from the Department’s Supervising Analyst to the then Secretary of the Department of Budget and Fiscal Planning, confirming the Secretary’s support for the Deputy Administrator position, and stating that the “recommendation was made in our survey conducted in 1976.” This letter, considered together with other documents showing that the Secretary directed that the Deputy Administrator position carry an unclassified personnel code number, supports the inference that the Secretary adopted the draft report’s findings that the position required expert training and expertise.
As to the third element, whether the Governor approved the Secretary’s determination, SABEL introduced into evidence a document showing that the Deputy Administrator position was approved by the Governor while acting as a member of the Board of Public Works.7 The transcript accompanying this document does not indicate that the Governor expressly recognized that the Deputy Administrator position was one which required expert training and qualifications. Nevertheless, an inference can be drawn *62that the Governor was aware of the nature of the Deputy Administrator position, the Department of Personnel’s recommendations concerning it, and the history of SABEL employees’ unclassified status. This evidence, although not strong, is not so insubstantial as to warrant overturning the agency’s decision, given the presumption of correctness with which agency decisions reach a reviewing court. See Bulluck v. Pelham Woods Apartments, supra, 283 Md. at 513, 390 A.2d 1119. In this regard, we are mindful that the heart of the fact-finding process often is the drawing of inferences from the facts. That function is committed to the agency, and the court may not substitute its judgment on the question whether the inference drawn is the right one or whether a different inference would be better supported. The test is reasonableness, not rightness. Bulluck, supra, 283 Md. at 515-16, 390 A.2d 1119, quoting Snowden v. Mayor & C.C. of Balto., 224 Md. 443, 448, 168 A.2d 390 (1961).
In determining whether there was substantial evidence to support the agency’s decision, we consider, in addition to evidence of compliance with § 3(13), other probative evidence on the record relied upon by the Secretary to support his decision. This includes the evidence showing that since its inception all SABEL employees, with the Governor’s approval, have been in the unclassified service and that the Secretary’s personnel codes have consistently identified these employees as unclassified. Coupled with this evidence, we consider as well the affirmative showing in this case that Billhimer did not satisfy the Act’s requirements for classified service status. Viewing the evidence in a light most favorable to the agency, as we must do, we conclude that the Court of Special Appeals erred in overturning the Secretary’s decision.
JUDGMENT REVERSED; CASE REMANDED TO THE COURT OF SPECIAL APPEALS WITH DIRECTIONS TO REMAND THE CASE TO THE CIRCUIT COURT FOR ANNE ARUNDEL COUNTY FOR THE ENTRY OF JUDGMENT AFFIRMING THE DECISION OF THE SECRE*63TARY OF PERSONNEL; COSTS TO BE PAID BY THE APPELLEE.
. Unless otherwise indicated, all section references are within Art. 64A.
. Although not here applicable, we note that ch. 543 of the Acts of 1988 amended the Act in several important particulars. Section 1(6) now defines "classified service” to mean “all positions for which persons are selected on a competitive basis” under the Act’s provisions. The term “unclassified service” is defined in § 1(20) to mean "all positions specifically excluded from the classified service” under the Act.
. According to the Annual Report of the Secretary of Personnel for the Fiscal Year ended June 30, 1987, 47,580 State employees are within the classified service while 9,457 are unclassified employees of the State.
. The boards of supervisors of elections, whose responsibilities are to “have charge of and make provision for all elections to be held” in their county or city, Art. 33, § 2-9, were created twelve years before SABEL. See ch. 739 of the Acts of 1957; Code, Art. 33, § 2-1.
. Section 1A-I(d) provides oniy that SABEL shall “consist of employees provided in the annual State budget from time to time.”
. Code numbers are used in Department of Personnel records to indicate whether the employee’s position is in the classified or unclassified service.
. Code (1980 Repl.Vol.), Art. 78A, § 16B requires approval by the Board of Public Works of any permanent position sought to be created in excess of those included in the budget.