
523 N.W.2d 73 (1994)
LAMPLIGHTER LOUNGE, INC., Plaintiff and Appellee,
v.
STATE of North Dakota ex rel. Heidi HEITKAMP, Attorney General, Defendant and Appellant.
Civ. No. 940119.
Supreme Court of North Dakota.
October 27, 1994.
*74 Sidney J. Hertz Fiergola, Sp. Asst. Atty. Gen. (argued), Maple Grove, MN, for defendant and appellant.
Richard B. Thomas (argued), Thomas Law Firm, Minot, for plaintiff and appellee.
NEUMANN, Justice.
The State of North Dakota ex rel. Heidi Heitkamp, Attorney General, appeals from the district court's award of attorney fees incurred in an administrative proceeding regarding the issuance of a liquor license. We affirm.
The factual background in this case is long and complicated. We have previously set it out and will only briefly recount the final stages which impact the instant case. See Lamplighter Lounge, Inc. v. State ex rel. Heitkamp, 510 N.W.2d 585, 586-88 (N.D. 1994) [hereinafter Lamplighter I] (setting forth the procedural history with regard to the first appeal). In the instant case, Lamplighter Lounge is seeking to recover attorney fees expended in connection with a second administrative hearing which was held while the Attorney General's appeal in Lamplighter I was pending. The hearing officer's determination in the second administrative *75 hearing was subsequently appealed to the district court, where it was reversed.
Lamplighter moved the district court to award attorney fees pursuant to NDCC section 28-32-21.1. In addition to that motion, Lamplighter also submitted an affidavit and a complete breakdown of the time spent on the second administrative hearing and the subsequent appeal of that hearing to the district court. In response the State, by brief, argued that Lamplighter failed to meet the requirements of section 28-32-21.1, NDCC, and therefore could not be awarded the fees sought. The State requested a hearing on this motion only if the court allowed Lamplighter to amend or supplement its request.
The court subsequently awarded attorney fees in a reduced amount, and judgment was entered. The State now appeals on two separate issues. First, it claims that its conduct was substantially justified, and second, it claims that the award was excessive.

I. Awarding of Attorney Fees
North Dakota Century Code section 28-32-21.1 controls when attorney fees may be awarded to parties adverse to a state administrative agency. (Supp.1993). The statute provides in pertinent part that "the court must award the party not an administrative agency reasonable attorneys' fees and costs if the court finds in favor of that party and, in the case of a final agency order, determines that the administrative agency acted without substantial justification." Id. § 28-32-21.1(1).
This statute sets forth a two-part test which must be met in order to properly award attorney fees: first, the nonadministrative party must prevail, and second, the agency must have acted without "substantial justification." Id. Here, the nonadministrative party prevailed and, therefore, the first requirement has been fulfilled. The second requirement is shaped by our definition of substantial justification. In defining this term we have been guided by the United States Supreme Court's definition of the term "substantially justified." Aggie Investments G.P. v. Public Serv. Comm'n, 470 N.W.2d 805, 814 (N.D.1991) (citing Pierce v. Underwood, 487 U.S. 552, 565, 108 S.Ct. 2541, 2550, 101 L.Ed.2d 490, 504 (1988)). There it was said that substantially justified means "`"justified in substance or in the main"that is, justified to a degree that could satisfy a reasonable person.'" Aggie Investments G.P., 470 N.W.2d at 814 (quoting Pierce, 487 U.S. at 565, 108 S.Ct. at 2550). A position may be justified, despite being incorrect, so long as a reasonable person could think that it has a reasonable basis in law and fact. Aggie Investments G.P., 470 N.W.2d at 814. Substantial justification represents a middle ground between the automatic award of fees to the prevailing party on one side, and awarding fees only when a position is frivolous or completely without merit on the other. Id.
Our standard of review on appeal, despite the fact it involves a purely legal issue, is to inquire whether the trial court abused its discretion in determining to award fees. Id. "A trial court abuses its discretion when it acts in an arbitrary, capricious, or unreasonable manner." Gissel v. Kenmare Township, 512 N.W.2d 470, 473 (N.D.1994). While we do not say we would necessarily have reached the same conclusion, the trial court's conclusion was neither arbitrary, capricious, nor unreasonable. Therefore, we conclude that the trial court's decision did not amount to abuse of discretion.

II. Determination of Reasonable Attorney Fees
When awarding attorney fees, "the court must ... allow the litigant an opportunity to present evidence in rebuttal and to cross-examine as to the reasonableness of the amounts claimed." Westchem Agric. Chems., Inc. v. Engel, 300 N.W.2d 856, 859 (N.D. 1980). Because in the instant case state funds (i.e. taxpayer monies) will be used to pay the fees, it seems only proper that the State be afforded an opportunity to test the credibility of the figures submitted to the court. See NDCC § 28-32-21.1(3) (providing that fees "awarded pursuant to this section must be paid from funds available to the administrative agency"). This request for fees should not, however, "result in a second *76 major litigation." Aggie Investments G.P., 470 N.W.2d at 815.
In the instant case, however, the State was given an opportunity to rebut the fee awarded. The State's response to Lamplighter's motion requesting attorney fees argued that the State acted with substantial justification, that the fees submitted were not specific, and finally that they failed to conform with the criteria announced by Hughes v. North Dakota Crime Victims Reparations Bd., 246 N.W.2d 774, 777 (N.D.1976). The State then waived a hearing on these issues as provided for by NDROC 3.2.[1] We cannot conclude that the State was denied the opportunity to rebut and cross-examine the reasonableness of the fees. They were given the opportunity but failed to seize it; this distinguishes the instant case from Aggie where "the PSC was not given the opportunity to be heard on" the issue of reasonableness of the fee award. Aggie Investments G.P., 470 N.W.2d at 815. In Aggie the PSC "was given neither notice of the amount of fees sought nor an opportunity to be heard on the issue." Id. at 814. Here the State was afforded both.
This failure to directly challenge the fees does not relieve the court of the duty to award reasonable fees, however. See NDCC § 28-32-21.1(1) (requiring the award of "reasonable" attorney fees). We have adopted guidelines for trial court judges to follow when determining the reasonableness of fees. Hughes, 246 N.W.2d at 777. Those guidelines are as follows:
(1) time and labor required (distinguishing between legal work in the strict sense, and investigation, clerical work, and compilation of facts and statistics); (2) the novelty and difficulty of the questions (he should not be penalized for accepting a challenge which may result in making new law); (3) the skill requisite to perform the legal service properly; (4) the preclusion of other employment by the attorney due to acceptance of the case; (5) the customary fee; (6) whether the fee is fixed or contingent; (7) time limitations imposed by the client or the circumstances; (8) the amount involved and the result obtained; (9) the experience, reputation, and ability of the attorney; (10) the undesirability of the case; (11) the nature and length of the professional relationship with the client; and (12) awards in similar cases.
Id.
In reviewing the trial court's order awarding partial attorney fees, we find that the court considered these twelve factors and reduced the requested amount by over $900. It is well established that trial courts are considered experts in determining legal fees and we will not reverse their determination of attorney fees absent a clear abuse of discretion. In re Estate of Flaherty, 484 N.W.2d 515, 519 (N.D.1992). We find no such abuse of discretion.
Affirmed.
LEVINE and MESCHKE, JJ., concur.
VANDE WALLE, Chief Justice, dissenting.
The law regarding the renewal of alcoholic beverage licenses was unsettled until our decision in Lamplighter v. State ex rel. Heitkamp, 510 N.W.2d 585 (N.D.1994) and, therefore, unsettled at the time of the second administrative hearing. Thus, I do not believe the conduct was without "substantial justification" as specified in section 28-32-21.1(1), NDCC, notwithstanding this Court's decision in Aggie Investments v. Public Serv. Com'n, 470 N.W.2d 805 (N.D.1991).
Without express legislative direction, I will not conclude that the Legislature intended an award of attorney fees in every instance when an administrative agency implements an ambiguous statute which is subsequently construed by the courts in a manner contrary to the agency's interpretation.
I therefore dissent.
*77 SANDSTROM, Justice, dissenting.
The focus of this case is the second administrative hearing held by the Attorney General. In Lamplighter v. State ex rel. Heitkamp, 510 N.W.2d 585 (N.D.1991), ("Lamplighter I"), this Court said the Attorney General lacked jurisdiction because of the doctrine of res judicata. Significantly, neither party argued res judicata in Lamplighter I! This Court, on its own, in its opinion, resolved Lamplighter I on the issue of res judicata.
To award attorney's fees the trial court must find the agency acted without substantial justification. N.D.C.C. § 28-32-21.1. The majority fails to offer any analysis of the justification provided by the Attorney Generalit simply asserts the trial court was not "arbitrary, capricious nor unreasonable." The majority begs the question. If the Attorney General was substantially justified, the trial court abused its discretion in awarding attorney's fees.
Prior to the second administrative hearing, Lamplighter failed to raise the issue of res judicata. Generally, res judicata must be raised in responsive pleadings or motion. See Rule 12(b), N.D.R.Civ.P. When Lamplighter failed to raise the issue before the hearing, the Attorney General was substantially justified in holding the hearing.
North Dakota law provides substantial justification for the Attorney General's position that res judicata was waived when not raised before the second hearing. In Borden v. Graves, 20 N.D. 225, 127 N.W. 104 (1910), this Court held (syllabus by the Court 4):
"In order that the estoppel of a judgment may become operative and effective, a party claiming its benefits must plead the adjudication in bar of a subsequent action, and on the trial establish it by competent proof; and a failure to do either will be held to be a waiver of the rights depending on such estoppel."
See also 46 Am.Jur.2d Judgments § 581 (1969).
Because the Attorney General was substantially justified, I would reverse.
NOTES
[1]  The State, in its brief to the trial court regarding attorney fees, waived oral argument on the motion unless "counsel for the Lamplighter be allowed to supplement or amend his request." Lamplighter, it appears, never supplemented or amended its request. Therefore, the event triggering oral argument on the motion never materialized and the State's waiver became conclusive.
