The petitioner, Bessie Hubbard (petitioner), was employed by North Carolina State University (NCSU) from 1985 through January 1998. On 1 July 1994, petitioner applied for the position of Building Systems Engineer III (position #6065) within the respondent Department of Administration’s (DOA) Office of State Construction (OSC). At the time she applied for this position petitioner was serving as the interim Assistant Director of the Physical Plant at NCSU where she was earning a salary of $48,636.00. Petitioner was neither interviewed nor hired for position #6065, which is a pay grade 80 position. The position was ultimately filled by Steve Weitnauer (Weitnauer), a DOA employee, with a starting salary of $48,197.00. Petitioner filed this claim, based on gender discrimination, in the Office of Administrative Hearings and a hearing was held on 21 August 1995.
The Administrative Law Judge (ALJ) issued a Recommended Decision on 11 January 1996, which concluded that petitioner had established a prima facie case of discrimination which most logically lends itself to a “disparate impact” analysis theory of discrimination. The AU also found that respondent had not given petitioner an equal opportunity for employment because it failed to give her an interview and violated its own affirmative action plan. The AU recommended that the respondent hire petitioner into a pay grade 80 position comparable to the one she applied for; compensate petitioner for back pay and lost benefits from 1 July 1994, the date on which she applied; pay petitioner front pay from the date of the decision until she is placed into a position; and pay petitioner all reasonable court costs and attorney’s fees.
The respondent appealed this decision to the State Personnel Commission (Commission) which entered its final decision, modifying the AU’s decision, on 12 June 1996. The Commission declined to *256accept the ALJ’s conclusions with respect to the “disparate impact” theory and the affirmative action plan. Nonetheless, the Commission found that the “[respondent's non-selection of [petitioner] for the position . . . was due to illegal discrimination on the basis of her gender” and ordered that petitioner be placed into the next available Building Systems Engineer III or comparable position; that she be awarded differential back pay from the date that [Weitnauer] was selected for the position and differential front pay until she is placed into a position; and that she be awarded attorney’s fees .... Respondent petitioned for judicial review and on 4 September 1997, the trial court reversed and vacated the Commission’s decision.
The pertinent facts of this case are largely undisputed. The position #6065 was filled after the following process took place: On 15 June 1994, the OSC sent the DOA Personnel Office a personnel requisition for a Building Systems Engineer III position. The requisition requested a posting for a position “IN-HOUSE.” On 21 June 1994, the DOA advertised position #6065 for “State Government Employees Only” with the closing date for applications set for 5 July 1994. Prior to January 1994, “in-house” or “internal” positions were advertised only to DOA employees. However, in January of 1994, the Secretary of the DOA issued a verbal change to the department’s advertising policy such that “in-house” or “internal” positions were to be advertised to all state employees and not limited to DOA employees.
After the deadline for submitting applications had passed, the DOA Personnel Office sent the four applications it received for position #6065 to the OSC. This packet included petitioner’s application.
After reviewing the four applications, the Director of OSC, Speros Fleggas (Fleggas) and the Assistant Director of the OSC, David Bullock (Bullock) interviewed two of the applicants. Both Fleggas and Bullock testified at the administrative hearing that the only reason petitioner was not interviewed was because she was not a DOA employee, as both were unaware of the policy change to allow all state employees to be considered for “in-house” or “internal” positions. (There was no question that petitioner was a state employee).
After the two interviews, the packet of applications was returned to the DOA Personnel Office where the applications were reviewed to determine whether the individuals who were interviewed met the minimum qualifications for the position. Three of the four applicants met the minimum requirements and petitioner was the only one of the three qualified applicants who was not interviewed.
*257The packet of applications, along with the recommendation to hire Weitnauer, was also reviewed by the DOA Affirmative Action Officer Rick Roberson (Roberson), who concluded that Weitnauer’s hiring met the DOA’s affirmative action goals.
Petitioner first argues that the DOA did not have standing to petition for judicial review of the Commission’s decision; however, we have carefully considered this assignment of error and find it to be without merit.
By her remaining assignments of error, petitioner argues that the trial court erred in reversing and vacating the Commission’s decision as it was not affected by error of law, was supported by substantial evidence in the record, and was not arbitrary and capricious.
The proper standard of review of agency decisions was articulated in Dorsey v. UNC-Wilmington, 122 N.C. App. 58, 468 S.E.2d 557, disc. review denied, 344 N.C. 629, 477 S.E.2d 37 (1996). In Dorsey, the petitioner alleged that she had been discriminated against on the basis of race in connection with an employment promotion. Id. at 60, 468 S.E.2d at 558. Before dealing with the substantive issues involved, this Court set out the following standard of review:
Chapter 150B of the North Carolina General Statutes, the North Carolina Administrative Procedure Act, governs trial and appellate court review of administrative agency decisions .... Although G.S. § 150B-51(b) lists the grounds upon which a court may reverse or modify an administrative agency decision, the proper standard of review to be employed by the court depends upon the nature of the alleged error. Amanini v. N.C. Dept. of Human Resources, 114 N.C. App. 668, 674, 443 S.E.2d 114, 118 (1994). If a petitioner asserts that the administrative agency decision was based on an error of law, then “de novo” review is required. Id. ... On the other hand, if a petitioner asserts that the administrative agency decision was not supported by the evidence, or was arbitrary and capricious, then the court employs the “whole record” test. Id. .. . The standard of review for an appellate court upon an appeal from an order of the superior court affirming or reversing an administrative agency decision is the same standard of review as that employed by the superior court. In re Appeal of Ramseur, 120 N.C. App. 521, 463 S.E.2d 254 (1995).
Id. at 62-63, 468 S.E.2d at 559-560.
*258Our Supreme Court in Act-Up Triangle v. Commission For Health Services, 345 N.C. 699, 483 S.E.2d 388 (1997) elaborated on the process for appellate review of a superior court order regarding an agency decision, stating the following:
“[T]he appellate court examines the trial court’s order for error of law. The process has been described as a twofold task: (1) determining whether the trial court exercised the appropriate scope of review and, if appropriate, (2) deciding whether the court did so properly.” “As distinguished from the ‘any competent evidence’ test and a de novo review, the ‘whole record’ test ‘gives a reviewing court the capability to determine whether an administrative decision has a rational basis in the evidence.’ ”
Id. at 706, 483 S.E.2d at 392 (citations omitted).
Thus, we must first determine whether the standard used by the trial court in addressing the respondent’s appeal from the Commission’s final decision was correct.
In the respondent’s petition for judicial review of the Commission’s final decision to the trial court, it alleged that the Commission’s decision was affected by error of law, was unsupported by substantial evidence, and was arbitrary and capricious.
The trial court’s order stated the following:
It is true that evidence supports the Administrative Law Judge’s findings of fact that the Department’s Affirmative Action Plan and other state policies designed to prevent discriminatory hiring were violated, and this would ordinarily justify the conclusion that gender discrimination exists. However, this conclusion, if merely based on a “prima facie” rule, cannot be maintained when it flies in the face of conclusive evidence of contrary intent and motivation. This is a classic example of how the “whole record” test operates.
By finding that gender discrimination cannot occur where there is “conclusive evidence of contrary intent,” the trial court applied the “whole record” test and made a determination that the Commission’s decision was not supported by substantial evidence in the record. Thus, pursuant to Dorsey, the trial court employed the appropriate scope of review.
Next, we must consider whether the trial court correctly applied the “whole record” test. As noted above, this test required the trial *259court to examine all competent evidence to determine whether the Commission’s decision was supported by “substantial evidence.” After-careful consideration, we conclude that the trial court correctly applied the “whole record” test and therefore did not err in finding that the Commission’s decision was not supported by “substantial evidence.”
The Commission’s decision, which modified the AU’s decision, upheld the finding that illegal gender discrimination had occurred when petitioner was not interviewed for position #6065.
In Dept. of Correction v. Gibson, 308 N.C. 131, 301 S.E.2d 78 (1983), our Supreme Court first established the evidentiary standards and principles of law to be applied in discrimination cases. Id. at 136, 301 S.E.2d at 82.
First, the claimant carries the initial burden of establishing a prima facie case of discrimination by a preponderance of the evidence. Id. at 137, 301 S.E.2d at 82. See also Dorsey, 122 N.C. App. at 63, 468 S.E.2d at 560. This burden is not onerous and can be established in various ways. Id. Moreover, the Court stated:
The showing of a prima facie case is not equivalent to a finding of discrimination. Rather, it is proof of actions taken by the employer from which a court may infer discriminatory intent or design because experience has proven that in the absence of an explanation, it is more likely than not that the employer’s actions were based upon discriminatory considerations.
Id. at 138, 301 S.E.2d at 83 (citations omitted).
Once aprima facie case of discrimination is shown, “a presumption arises that the employer unlawfully discriminated against the employee” and the burden shifts to the employer to articulate some legitimate nondiscriminatory reason for the applicant’s rejection. Id.
With respect to this burden placed on the employer, the Court in Gibson noted the following:
[A]fter a plaintiff proves a prima facie case of discrimination, the employer’s burden is satisfied if he simply explains what he has done or produces evidence of legitimate nondiscriminatory reasons. The employer is not required to prove that its action was actually motivated by the proffered reasons for it is sufficient if the evidence raises a genuine issue of fact as to whether the claimant is a victim of intentional discrimination. It is thus clear *260that “[t]he ultimate burden of persuading the trier of fact that the defendant intentionally discriminated against the plaintiff remains at all times with the plaintiff.
Id. at 138, 301 S.E.2d at 83. Once the employer meets the above requirement, the presumption of discrimination is successfully rebutted. Id. at 139, 301 S.E.2d at 84.
After an employer explains the nondiscriminatory reasons for his actions, “the claimant has the opportunity to show that the stated reason [given by the employer] for rejection was, in fact, a pretext for discrimination.” Id. at 137, 301 S.E.2d at 82. The Court further noted:
The trier of fact is not at liberty to review the soundness or reasonableness of an employer’s business judgment when it considers whether alleged disparate treatment is a pretext for discrimination .... While an employer’s judgment or course of action may seem poor or erroneous to outsiders, the relevant question is simply whether the given reason was a pretext for illegal discrimination. The employer’s stated legitimate reason must be reasonably articulated and non-discriminatory, but does not have to be a reason that the judge or jurors would act upon or approve .... The reasonableness of the employer’s reasons may of course be probative of whether they are pretexts. The more idiosyncratic or questionable the employer’s reason, the easier it will be to expose it as a pretext, if indeed it is one. The jury must understand that its focus is to be on the employer’s motivation, however, and not on its business judgment.
Id. at 140, 301 S.E.2d at 84.
In Gibson, the Supreme Court upheld the Commission’s determination that the claimant, a black employee who had been fired after prisoners under his care escaped, had established a prima facie case of discrimination where he had shown “that even though he and several white employees failed to make proper checks to insure the presence of [the prisoners] on 23-24 April 1979, only he was discharged.” Id. at 142, 301 S.E.2d at 85. Moreover, the Court upheld the Commission’s conclusion that the Department of Correction (DOC) had clearly articulated a legitimate nondiscriminatory reason for discharging the claimant, i.e. that claimant was discharged for failure to make proper checks during his shift; failure to report a suspicious situation; and that the claimant’s conduct constituted greater negligence than the conduct of other employees. Id. The claimant *261in Gibson then presented evidence in an attempt to prove the reasons stated by the DOC were a mere pretext for racial discrimination by showing that the DOC had not discharged a white employee for acts that were comparable in seriousness to those of the claimants. Id.
Our Supreme Court ultimately held that the Commission’s decision was affected by an error of law as the Commission “failed to resolve the ultimate question involved in this appeal . . . [as] [t]he record does not disclose that the Commission . . . concluded that plaintiff was a victim of intentional discrimination.” Id. at 147, 301 S.E.2d at 88. The Commission’s order did conclude that “ ‘[a]s a practical matter discriminatory acts may not be recognized as such by those who commit them.’ ” Id. The Court took exception to this finding indicating that it was a “misapprehension of the law... and defies reason to say that a person could have the animus or motivation to intentionally practice discrimination upon a person because of his race without being aware of such animus or motivation.” Id.
While Gibson dealt with racial discrimination, the same principles apply to the instant case where petitioner alleges that she was denied an interview for position #6065 on the basis of gender discrimination.
We first examine the record to determine whether petitioner presented substantial evidence sufficient to show a prima facie case of gender discrimination. Petitioner’s evidence tended to show the following: As a State employee she was entitled to be considered for position #6065; of the four applicants for the position, three applicants, including herself, met the minimum requirements; two of the three qualified applicants were male and petitioner is female; both qualified male applicants were interviewed for the position and petitioner was not; ultimately a male with qualifications comparable to petitioner was hired for the position. Thus, we find that petitioner has met her initial burden of establishing a prima facie case of gender discrimination.
Next, we examine the reasons given by the respondent for its decision not to interview petitioner for “in-house” position #6065. Fleggas testified that he made the decision to advertise this position as an “in-house” position and that he believed that “in-house” meant only DOA employees would be considered. Both Fleggas and Bullock, who were in charge of deciding which applicants to interview, testified that the sole reason that petitioner was not interviewed was *262because she was not a DOA employee. Moreover, this evidence was not contradicted by petitioner. Additionally, there was evidence presented that at the time this position was posted, “in-house” meant all state employees were eligible; however, prior to January 1994, “in-house” had indeed meant DOA employees only. Further, the DOA’s affirmative action officer testified that he reviewed the packet of applications along with the recommendation to hire Weitnauer and determined that the recommendation met the DOA’s affirmative action goals. We find the evidence is sufficient to meet the employer’s burden of rebutting the presumption of discrimination and raises an issue of fact as to whether petitioner was the victim of intentional discrimination pursuant to Gibson. Thus, the burden shifts back to petitioner to show that the reason stated by the respondent for its failure to interview her for position #6065 was in fact a pretext for gender discrimination.
Petitioner’s evidence shows that pursuant to N.C. Gen. Stat. § 126-16 and its corresponding regulations, the DOA developed a departmental affirmative action plan each year. The 1994 plan required that the DOA interview at least three applicants representative of the ethnic, sex and disability composition of the available applicants “unless there are fewer than three who meet the minimum educational and experience requirements for the position.” Thus, petitioner’s evidence tends to show that the DOA violated its own affirmative action plan when it did not interview petitioner.
Our focus, however, is on whether petitioner presented substantial evidence that she was intentionally discriminated against because of her gender. While we do not condone DOA’s failure to adhere to its Affirmative Action Plan, the respondent presented uncontradicted evidence that the DOA employees who decided not to interview petitioner were under the genuine, although mistaken, belief that only DOA employees were eligible for consideration for position #6065. We find this belief to be legitimate in light of the fact that until January 1994, “in-house” positions were only open to DOA employees and not to all state employees. Therefore, we cannot conclude that this failure equates to gender discrimination. Thus, we hold that the record does not include substantial evidence sufficient for petitioner to meet her burden of showing that the DOA’s reason for not interviewing her was a pretext for illegal gender discrimination.
The order of the trial court is
*263Affirmed.
Chief Judge EAGLES and Judge HORTON concur.