The Republican Party has filed a formal complaint with the D.C. bar seeking disciplinary measures against longtime Hillary Clinton aide Cheryl Mills for allegedly having a 'conflict of interest' when representing Clinton during her FBI interview in connection with her emails scandal.

Mills has represented Clinton as she fielded questions from FBI investigators as well while also fielding questions from congressional staff and lawmakers about whether she mishandled classified information and broke record keeping laws with her private email server.

Mills was at the candidate's side when she met with FBI investigators in July, in keeping with that role.

But according to the RNC, she may have violated a rule of professional conduct against a lawyer taking 'other employment in connection with a matter which is the same as, or substantially related to, a matter in which the lawyer participated personally and substantially as a public officer or employee.'

The Republican National Committee has written a formal complaint to the D.C. bar charging longtime Hillary Clinton aide Cheryl Mills with violating a conflict rule by representing Clinton while also getting an immunity deal for herself related to the Clinton email investigation

'Cheryl Mills was a target of the FBI criminal probe into Clinton's server and then represented Clinton, who was another possible target, in the same probe. She either had a clear conflict, or was the central figure in covering up Hillary Clinton's crime,' RNC research director Raj Shah told DailyMail.com.

Mills also served as Clinton's chief of staff and counselor at the state department – a taxyaper-funded job that brought her under federal record keeping requirements related to preservation of documents.

As such, she was of interest to investigators trying to uncover how Clinton's private server run out of her home was established and who if anyone knew that it might have come into conflict with laws requiring preservation of official government records.

PRO SE: Clinton spoke with African American community leaders at Mert's Heart & Soul restaurant in Charlotte. When she met with FBI investigators, she was accompanied by attorney Cheryl Mills, who got a partial immunity deal

Cheryl Mills was granted partial immunity by the FBI during its investigation into Clinton's emails

Mills was granted partial immunity by the FBI during the course of its investigation.

House Oversight Committee chairman Jason Chaffetz of Utah has complained that the FBI was handing out immunity deals 'like candy' during its investigation, where FBI director James Comey ultimately decided not to recommend charges but faulted Clinton for extreme 'carelessness' with her server.

Comey pushed back when GOP congressional investigators faulted his decision. ''You can call us wrong but don't call us weasels,' he said last week. 'We are not weasels, we are honest people.'

'Of all of the individuals who would warrant immunity, most would view Mills as the very last on any list, George Washington University law professor Jonathan Turley wrote in an op-ed.

Michael Krauss, who teaches legal ethics at George Mason University in Virginia,told Bloomberg News: 'Was she merely aware of this issue or was she active?'

'There is no active dispute between the Department of State and Mrs. Clinton,' he said.

LONG HISTORY: Cheryl Mills and Hillary Clinton take a break in a hearing of the House Select Committee on Benghazi October 22, 2015 on Capitol Hill in Washington, DC in 2015

Hillary Clinton spoke at a Sunday service at Little Rock AMC Zion Church in Charlotte, North Carolina this past weekend

Comey, however, testified that his office provided immunity in order to move ahead with its investigation and gain access to Clinton emails – and said it was 'not irregular' for her to then represent Clinton as her attorney.

According to the RNC letter, written by research director Raj Shah:

'During the time Secretary Clinton allegedly mishandled classified information, Ms. Mills was serving as Secretary Clinton’s chief of staff and counselor at the State Department. Bryan Pagliano, a former State Department employee and Clinton campaign staffer, told federal investigators that, in 2009 or 2010, he approached Ms. Mills relaying State Department concerns that Secretary Clinton’s private email server might pose a federal records retention issue.'

Pagliano has himself pleaded the Fifth Amendment and has refused to testify to congressional investigators about the Clinton email server he helped set up.

'F.B.I. Director James Comey confirmed during congressional testimony that Ms. Mills was a subject of the investigation,' the letter continues. 'Indeed, Ms. Mills was granted partial immunity for cooperation with federal agents in the investigation. According to news reports, during the course of Ms. Mills’s interview with the F.B.I., she was asked questions concerning the processes and procedures used to produce Secretary Clinton’s emails to the State Department, to which Ms. Mills asserted the attorney-client privilege.'

According to the letter, the immunity grant 'highlights the apparent conflict of interest in her representation of Secretary Clinton. Director Comey testified that the F.B.I. granted immunity to Ms. Mills because her current role as Secretary Clinton’s attorney could have posed potential legal issues for the F.B.I. in its attempt to subpoena Ms. Mills’s laptop.

'Ms. Mills apparently used her current role as Secretary Clinton’s attorney to shield herself from prosecution in the event any classified information was discovered on her laptop,' according to the letter.

The Clinton camp did not immediately reply to a request for comment.