Correction: An earlier version of this story incorrectly said that a Star Scientific spokeswoman noted that the company has shifted its focus from tobacco to dietary supplements. In fact, she said the company has expanded its focus on pharmaceuticals. This version has been corrected.

Star Scientific founder Jonnie Williams left, and Maureen McDonnell, wife of Virginia Gov. Robert F. McDonnell. (Michele White/AP)

Star Scientific, the company whose chief executive is at the center of Virginia Gov. Robert F. McDonnell’s gift scandal, has agreed to pay the state more than $900,000 to settle a dispute over back taxes.

The company reached the legal settlement with the state last month, averting a trial that had been scheduled to begin Friday.

The tax fight was the subject of the first public scrutiny into Star Scientific’s interactions with top elected leaders in Virginia, and it was a key issue in the recently concluded campaign for governor.

Star Scientific, a former discount cigarette manufacturer, filed suit against Virginia in 2011, contesting a tax assessment of more than $700,000 levied on tobacco curing barns the company owns in southern Virginia.

The case then lingered without resolution for nearly two years.

Democrats argued that Virginia Attorney General Ken Cuccinelli II, the Republican nominee for governor in November, held an unethical conflict of interest in the matter because his office was defending the state against the suit even as he owned stock in Star Scientific and had accepted gifts from its chief executive, Jonnie R. Williams Sr.

They suggested Cuccinelli may have instructed his office to “slow-walk” the case to help the company. Star told investors in September that it would owe $1.9 million in taxes, interest and penalties if it lost the case.

Cuccinelli, who lost the November election to Gov.-elect Terry McAuliffe (D), insisted that the case had been handled as a routine matter by staff lawyers and that there had been no unusual delay in its resolution.

Although Cuccinelli acknowledged that Williams had once complained to him about the tax dispute, there was no evidence that the attorney general had intervened in the matter.

Still, the legal fight tightly linked him to the Star story as details of McDonnell’s far more extensive interactions with Williams began to emerge.

McDonnell (R) and his family accepted more than $165,000 in gifts and loans from Williams, including vacations, designer clothing and a Rolex watch. The governor’s relationship with Williams is now the subject of federal and state criminal investigations.

Under pressure, in April, Cuccinelli announced that he had appointed an outside counsel to handle the case instead of his office.

A Democratic former attorney general and a Republican former state solicitor general agreed to jointly handle the case at no cost to the state. With public attention focused on the once-little-noticed lawsuit, a trial date was quickly set and mediation began.

According to the Nov. 18 settlement agreement, Star agreed to pay $975,000 in taxes, penalties and interest.

In the written agreement, the two sides agreed they would not initiate public disclosure of the agreement. But they agreed that the Virginia Department of Taxation would be allowed to release it in response to a request filed under Virginia’s Freedom of Information Act.

Star spokeswoman Talhia Tuck said the company continued to believe in the validity of its position on the tax issue. But she noted that the company’s focus has shifted.

“Given the Company’s expanded focus in the pharmaceutical and biotech areas, we thought it was in the Company’s best interest to resolve this matter at this time and focus our resources on our core business as we continue with the transition that is currently underway,” she said in a statement.

Brian Gottstein, a spokesman for Cuccinelli, said his office’s position had always been that Star owed the taxes and now the company will be paying them. He thanked the private attorneys for working for free to resolve the matter.

The settlement resolved a long-standing dispute. Virginia levied the tax bill in 2002 after concluding that Star had been incorrectly claiming a manufacturing exemption to the state’s sales and use tax since 1999.

Star appealed the ruling with the Virginia Department of Taxation for years before filing suit in 2011.

Cuccinelli was cleared of wrongdoing in his interactions with Williams by Richmond Commonwealth’s Attorney Michael D. Herring in July.

Star Scientific has announced that Williams will step down as chief executive of the company following a shareholders meeting this month and take a different role with the company. Star will change its name to Rock Creek Pharmaceuticals.