AUGUSTA — A legislative committee voted unanimously Tuesday in favor of confirming Gov. Paul LePage’s chief legal counsel as a District Court judge, but only after Democrats scrutinized Cynthia Montgomery’s court experience and loyalty to a Republican governor who frequently tests the legal boundaries of his authority.

The Judiciary Committee’s endorsement also came after an unexpected appearance by LePage, who hurried up two flights of stairs at the State House to defend his top lawyer.

“You should not bring her up here and have this be partisan,” LePage told the committee. “This shouldn’t be a game. If you want to have a game, you should come to me because I’m the guy you have games with.”

LePage’s impromptu appearance provided a bizarre twist to a confirmation hearing preceded by questions about whether Democrats on the panel would reject Montgomery’s nomination. Montgomery has become a central figure in the governor’s repeated entanglements with Democratic Attorney General Janet Mills and, on two occasions, clashes with the Legislature.

On Friday, Mills warned Montgomery that the administration is breaking the law by allowing approximately 14 lawyers hired by the Department of Health and Human Services to “hold themselves out as attorneys” and provide legal counsel to the state agency. Mills warning followed a Jan. 8 letter from Montgomery telling the attorney general that the administration does not trust her or, by extension, her office.

The vote by the Judiciary Committee is the first step in Montgomery’s confirmation. Only a two-thirds vote by the Senate can overturn the panel’s recommendation. The Senate vote could take place as soon as Thursday.

Members of the Judiciary Committee quizzed Montgomery about her work for LePage and her litigation experience.

“He (LePage) is no doubt a man of his own mind,” she said. “It showed me what it really means to represent somebody and put my personal feelings aside.”

At several points, Sen. Chris Johnson, D-Somerville, questioned Montgomery’s court experience, which she acknowledged is lacking compared to other occupants of the bench.

“Maine has a great history of having a diverse bench,” she said. “There are lawyers on the bench who have a ton of experience and many who don’t.”

Montgomery’s letter exchange with Mills surfaced during her confirmation hearing, as did her defense of LePage in high-profile disputes with the Legislature.

Montgomery said the “tone and content of the letters” to Mills were the governor’s, not hers. She said the dispute over the DHHS attorneys is a legitimate legal question. She was asked several times if she had staked a legal position to appease LePage that might be at odds with state law.

“There are legitimate disagreements about the meaning of words. … I think you can have a legitimate dispute without breaking the law,” Montgomery said.

Montgomery, who joined the administration full time in 2015, has been on the hot seat since last summer.

In July, she wrote a defiant letter to the Legislature’s watchdog agency asserting it had no ability to investigate LePage during its review of the governor’s threat to withhold state funds from a private nonprofit in Fairfield unless it rescinded its job offer to House Speaker Mark Eves. Montgomery also vigorously attempted to block the Legislature’s processing of over 60 bills that the governor failed to veto in time and led the administration’s effort to block the bills from becoming law by seeking an opinion from the Maine Supreme Judicial Court. The court later decided against Montgomery and the administration.

Rep. Jeffrey Evangelos, an independent from Friendship, questioned whether Montgomery’s loyalty to LePage had clouded her legal judgment.

“I have never withheld my opinion from the governor,” she answered. “A lawyer’s job is to give information and advice. I’m not going to do something that would really jeopardize my client.”

Montgomery described her experience in the governor’s office as challenging and rewarding, but one consistent with the traditional attorney-client relationship.

“If you knew me as a person, you’d see me as a neutral person,” she said. “I tend to judge conduct, but I’m not a person who typically judges people. I think I have the ability to make a contribution.”

LePage also defended Montgomery in the veto debacle, saying it was his mistake.

Montgomery is a Dallas, Texas, native and received a law degree from Georgia State University in 1994. She now lives in Palermo and was admitted to the Maine bar in 2009. She has had one appearance in court over the last five years – the veto case decided by the supreme court last year. Montgomery had multiple appearances in Georgia courts, handling a variety of employment discrimination and civil rights claims. And before joining the governor’s office full time in 2015, Montgomery participated in a number of employment and labor relations arbitration cases, representing unions, employees and management.

Under Maine law, the only requirement is that the nominee is eligible to practice law in the state and, in some cases, reside in the district in which he or she will appear.

LePage told the committee that Montgomery’s inexperience in court is an asset.

“(The) fact that she doesn’t have a whole lot of courtroom experience is an advantage,” he said. “She has the law in mind. She doesn’t have biases. And that’s important.”

LePage arrived at the hearing after apparently listening remotely and taking offense to a comment made by Sen. Roger Katz, R-Augusta, that Montgomery was qualified to serve on the bench before she joined the LePage administration a year ago. Katz went on to argue that Montgomery is still qualified and should not be blamed for her client’s legal positions, but the governor apparently did not hear the latter part of Katz’s testimony.

The governor quickly left his office, accompanied by his security detail and heading for the Judiciary Committee. Along the way he asked passers-by in the hallway for the location of the hearing room, at one point veering toward the Senate Democratic offices with his query. Once in the committee room, he accused Katz of “targeting” his administration.

After the meeting, Katz was incredulous.

“I was there to support his nominee,” he said. “I was trying to do something nice.”