Gov. Robert F. McDonnell wraps up his term Saturday with soaring expectations painfully half met.

As Virginia’s 71st governor, McDonnell (R) enjoyed one of the most productive tenures in recent history, amassing meaty accomplishments that even critics said would give him a credible shot at national office.

But his hefty record and political future have been clouded by something that would be a first for a modern-day Virginia governor: a potential criminal indictment.

Federal prosecutors told McDonnell and first lady Maureen McDonnell in December that they intended to bring charges related to more than $165,000 in luxury gifts and loans that Virginia businessman Jonnie R. Williams Sr. showered on their family. The prosecutors later delayed action after the couple’s attorneys made an in-person appeal to Justice Department officials in Washington, The Washington Post has reported.

Whatever the resolution of the criminal matter, the scandal has at least temporarily overshadowed McDonnell’s record — and promises to leave a broader, lasting impact on the commonwealth. McDonnell’s woes helped doom fellow Republicans in the November election, contributing to the first Democratic sweep of statewide offices in decades. The episode has stained the reputation of a state that cherishes its history of clean government. And it has inspired one of the near-certainties of this year’s General Assembly session: ethics reform.

The paradox of McDonnell’s substantial but sullied legacy was on display during his final State of the Commonwealth speech Wednesday. Savoring his accomplishments, he launched into an hour-long review of his administration’s successes. He was lighthearted and breezy at times, ad-libbing a bit about the tech-heavy state having the nation’s “highest concentration of geeks.”

But toward the end, after swallowing hard twice, he made a somber if somewhat lawyerly apology.

“While choices I have made have been legal, and as several reviews have shown, no person or company received any special benefits during our administration, I understand that there’s been adverse public impression of some of my decisions or choices that I have made,” McDonnell said. “I have prayed fervently over the last months that the collective good that we have done would not be obscured by this ordeal.”

The scandal tripped up what Republicans and even some Democrats regard as an otherwise excellent state executive. His list of accomplishments — striking a once-in-a-generation transportation-funding deal, reforming the state’s underfunded pension system, holding down college tuition, preserving the state’s stellar business and bond ratings — has a tawdry corollary: a $6,500 Rolex for the governor, a $15,000 Bergdorf Goodman shopping spree for the first lady, $15,000 and $10,000 gifts to two bride-to-be McDonnell daughters, and $120,000 in money, described as loans, to the governor and first lady.

“If you strip away all of the issues with regard to the gifts, then what you see is probably one of the most effective governors Virginia has had in quite a long time,” said state Sen. William M. Stanley Jr. (R-Franklin).

McDonnell declined an end-of-term interview with The Post, the newspaper that brought the gifts scandal to light. But in exit interviews he granted to news media outlets around the state, as in his speech Wednesday, the governor has compared himself to a Boy Scout who “left the campground a little better than we found it.”

McDonnell swept into office on a 17-point landslide but enjoyed a short honeymoon. His chief legislative goal — selling state-run liquor stores to fund transportation — died without a hearing.

Early on, he issued a proclamation commemorating Confederate History Month that failed to mention slavery. Amid complaints, McDonnell initially dug in instead of acknowledging the omission, saying he only meant to hit upon the “most significant” issues of the Civil War.

To critics, the episode was a hint that the new governor would be a lightning rod for divisive social issues. McDonnell had made his name in the House of Delegates as a conservative cultural warrior, but he focused on bread-and-butter issues as attorney general and promised with his “Bob’s for Jobs!” slogan to do the same as governor.

Yet McDonnell went on from there to become a champion for the restoration of civil rights to ex-felons. Former Republican congressman Thomas M. Davis III said McDonnell’s conservative credentials allowed him to push harder on that issue than his Democratic predecessors, calling it “a Nixon-goes-to-China thing.”

“I think he believes in redemption and that we all serve a God of second chances,” said state Sen. A. Donald McEachin (D-Henrico).

Fiscal conservatives gave McDonnell high marks at the start for holding the line on taxes. Former governor Timothy M. Kaine (D) had left McDonnell with a two-year budget plan that included a $2 billion tax increase. McDonnell managed to avoid that by paring spending to 2006 levels. At the same time, he plowed $100 million into state colleges and universities and accelerated the issuance of $2.9 billion in transportation bonds for the state’s clogged roads.

In 2013, McDonnell bucked his party’s base to sign a transportation funding plan stuffed with $1.2 billion in new annual taxes. Fiscal conservatives were furious, but moderate Republicans and Democrats gave him high marks for solving a problem that other governors had tried and failed to fix.

“He understands the art of compromise,” said Bobbie Kilberg, president of the Northern Virginia Technology Council.

With aggressive economic development deals and numerous foreign trade missions, McDonnell helped keep the state’s unemployment rate well south of the nation’s. His administration created a net of 175,000 jobs, closed 1,350 economic development deals and logged record exports in agriculture and forestry — the state’s biggest industries. Virginia topped Forbes magazine’s “Best State for Business” ranking last year.

“The slogan that the governor ran on four years ago, ‘Bob’s for Jobs,’ became a mantra,” said Todd Haymore, secretary of agriculture and forestry.

Social issues flared again in 2012 with a bill requiring that women get an ultrasound before an abortion and be offered a view of the fetus. McDonnell voiced support before a key detail became widely known: because most abortions take place early in pregnancy, when a fetus is too small to be viewed with an abdominal ultrasound, a vaginal ultrasound would be required.

Opponents lambasted the measure as “state-sponsored rape.” McDonnell eventually stepped in and got the measure to specify the less-invasive abdominal ultrasound but not before Virginia’s GOP found itself lampooned on “Saturday Night Live.” Democrats used that bill, as well as tougher abortion-clinic regulations approved under McDonnell, to help make the case that the GOP is waging a “war on women.”

Some social conservatives who helped sweep McDonnell into office objected to his softening the ultrasound bill and felt that he was generally sidestepping cultural issues. He walked a fine line on the appointment of the state’s first openly gay judge and last year quickly complied with a Pentagon directive to pay benefits to the same-sex partners of National Guardsmen.

“He was very, very quick when the spotlight got hot to jettison those ideals in protection of his own ambitions,” said Steve Waters, a conservative Republican strategist.

But those compromises helped boost McDonnell’s national profile as a pragmatic, soft-rhetoric conservative. He was in the mix in 2012 to be the GOP vice presidential nominee, and he was a prime-time speaker at the Republican National Convention. He seemed on the road toward a presidential bid of his own in 2016.

McDonnell’s prospects started to dim in March, when The Post reported that the governor and first lady had promoted Star’s nutritional supplement, Anatabloc, about the time that Williams picked up the $15,000 catering tab at their daughter’s wedding. In the weeks and months that followed, the paper reported on luxury gifts and five-figure checks. The governor has said he did nothing for Star that he would not do for any Virginia-based enterprise. He returned the gifts and money.

The governor has lost weight since the scandal broke and looks drawn. While he laid low in the race to succeed him, he has gone to great lengths to show he has remained active and engaged as governor.

“It’s the kind of issue that gnaws at your gut on a consistent basis, and I think it takes a person of immense strength to put that aside and move forward with a positive agenda,” said Fred Malek, a Republican hotel executive and McDonnell backer. “A true test of a person’s character and conviction is their performance under adversity. It’s easy to ride a big wave in. It’s much tougher to swim against the tide. And he has done that with courage and conviction.”