Gov. Mark Dayton is leaving office in January after eight years with a far-reaching legacy that will endure for decades.

A glassy new Vikings stadium rises on the east edge of downtown Minneapolis, ringed by new office towers and condos. Rochester is on the verge of a dramatic, multibillion-dollar state-backed transformation. Minnesota's rainy-day fund is at record levels and the unemployment rate is at an 18-year low. Education spending is up more than $2 billion.

Through a mix of good economic fortunes, shrewd political skill and the missteps of his opponents, Dayton's tenure has reshaped Minnesota in innumerable ways. He locked in higher spending that will be difficult to roll back, with the help of new taxes on high earners. A vast expansion of the Medical Assistance program reduced the number of uninsured. He's appointed more than half of the state's judges, a pool that is more racially diverse and female than ever before.

"He's the most consequential governor in recent history," said Wy Spano, past director of Metropolitan State University's political leadership program.

The Democratic governor also drew sharp criticism for mismanaged government programs like the rocky rollout of a health insurance marketplace and a nearly $100 million, decade-in-the-making vehicle registration system. Allies were at times disappointed when he declined to push further on progressive priorities, or sided with business over the environment. Republicans and many business leaders said his tax increases would make Minnesota less competitive.

"He's missed opportunities to solve the state's biggest problems," said House Speaker Kurt Daudt, R-Crown, who said Republicans deserve credit for preserving the state's economic recovery in the face of Dayton's policies. Educational and economic outcomes between whites and people of color, for instance, remain vast and persistent, despite significant spending to close the gap.

The rigors of governing also took a physical toll. Dayton has spent much of the last few years working out of the governor's residence a few miles from the Capitol recuperating from hip, back and lung ailments that sharply limited his ability to campaign or make public appearances. In 2017, Dayton frightened legislators and the public when he fainted from dehydration during his annual State of the State address. That year, he underwent surgery for prostate cancer.

Rather than relishing his final weeks in the newly renovated State Capitol or embarking on a final swing through the state to thank the thousands of supporters whose names and faces he's known for generations, Dayton is quietly ending his four-decade political career at his Summit Avenue home recuperating.

"It's been an awful couple of months. There are things I haven't been able to do," said Dayton, like handing out Halloween candy to children at the residence and visiting Worthington, Minn., to celebrate the completion of a major water project. His mobility is limited, and he often appears out of breath.

His vulnerability has shaped him, he said.

"It puts in perspective my own good fortune, and has helped my ability to understand what people are going through," he said during an interview last week.

Dayton's two-term legacy is likely to be aided by the election of DFL Gov.-elect Tim Walz. It is the first time a Democrat has handed the office to another Democratic since 1976, when Dayton's mentor, Rudy Perpich, succeeded Wendell Anderson.

Daudt, meanwhile, Dayton's most lacerating critic, is being relegated to the minority after a sweeping Democratic victory in the November election.

Dayton was once the picture of dark-haired, Kennedy-esque vitality, married to a Rockefeller heiress and known for the lavish parties he threw at DFL events. But it's never been easy for the introverted Dayton, despite a vast fortune from the family's department store dynasty that would eventually become Target.

Through his decades of public life, Dayton soldiered through divorces and addiction, depression, the death of his friend and political mentor Sen. Paul Wellstone and — in recent years — failing health.

"Everyone needs a good reason to get out of bed in the morning. This job has given me that reason in multiples," Dayton said. "The opportunity to make a difference.

"All-day kindergarten makes a real difference in so many people's lives," he said, referring to one of his major achievements, which was later paired with an expansion of prekindergarten for the state's most vulnerable children.

In the face of his own fragility, Dayton spent much of his political capital building things across the state.

"When he advocated for 'The People's Stadium,' everything changed," said state Sen. Tom Bakk, D-Cook, referring to the significant political muscle and state dollars Dayton put toward the Vikings stadium.

Rochester is undergoing a massive building boom, thanks in part to the Destination Medical Center, a $5.6 billion plan Dayton signed that fuses public money to private investment.

Dayton formed an unlikely political alliance with then-Republican Rep. Michele Bachmann to build the St. Croix River Bridge, at a cost to Minnesota of more than $360 million. He pushed to spend millions more for the recently completed Lewis and Clark Water System.

Dayton worked fiercely to overcome cost overruns and embarrassments that may have persuaded other governors to nix the troubled Southwest light-rail project. Dayton toughed it out, and the project broke ground in November.

Amid all this came the $309 million renovation of the State Capitol, which meant Dayton and his staff spent years in temporary offices. "That had been talked about for decades around here, and nobody could figure it out," said Bakk, who was at times a fierce rival to Dayton, accused once by the governor of "stabbing me in the back."

All the building was deliberate, said Kathy Tunheim, an adviser and head of a prominent public affairs firm.

The state was emerging from the worst recession in decades. Tunheim said Dayton asked, "Who is out of work? And what can government do to change that trajectory?"

The answer was construction workers, from architects to laborers.

With the economy snapping back, Dayton instituted his signature proposal of a fourth income tax tier on the highest-earning Minnesotans. The state repaid money borrowed from school districts and entered a period of budget surpluses and a AAA bond rating last summer, giving the incoming Walz administration the gift of fiscal flexibility that Dayton lacked in his first two years.

But Dayton has also disappointed progressive allies who felt he had to be dragged along on medical marijuana, avoided the gun issue for much of his tenure, or that he sided with business over the environment.

Although Dayton sought to make clean water a signature issue in his second term — fighting for a law to protect streams from farm pollutants and opposing mining near the Boundary Waters — his administration approved Minnesota's first copper-nickel mine.

"They were good at raising the public profile of the issue, but frequently the decisions they made were at cross purposes with the goal," said Aaron Klemz of the Minnesota Center for Environmental Advocacy.

Allies also grew frustrated with what they saw as his habit of laying down his arms to the opposition after he had gained the advantage in a fight.

Some DFL operatives and labor leaders were livid when Dayton ended a government shutdown in 2011 even though Democrats believed they were winning the public relations battle.

When Republicans tried to force him to sign a tax-cut bill in 2017 by withholding money to run his Department of Revenue, Dayton caved. Even after winning a high-stakes court fight with the Legislature, he ultimately relented without anything to show for it.

That 2017 battle with the Legislature, which wound up at the Supreme Court, was the low point of his acrimonious relationship with lawmakers, especially the bookended years of Republican control.

Dayton's veto of the Legislature's money for salaries and staff was viewed by lawmakers as an attempt to eliminate a coequal branch of government, and will likely be studied by scholars examining the relationship between the two branches of government.

"That we were an equal branch of government with real power — it frustrated him," said state Sen. Paul Gazelka, R-Nisswa, the Republican majority leader.

Still, Gazelka said, he could not help but like Dayton.

"I remember calling him up and saying, 'Governor, for whatever reason, God has given me a love and respect for you I just can't shake."

Gazelka is like many Minnesotans that way. Dayton's job approval in a 2017 Star Tribune Minnesota Poll was the highest of his career.

Jeff Blodgett, a longtime DFL operative, said even Minnesotans who didn't agree with Dayton often came to like and respect him because of his self-deprecation, authenticity and the clear sense of his values that he conveyed — often bluntly. In nearly every public appearance, he told a self-deprecating joke about his age or foibles and fumbled over some words, but he would then make a definitive statement of his beliefs, even when it seemed he was exacerbating a conflict.

"It's hard to be 100 years old," he joked earlier this year to children at a St. Paul elementary school — he never looked happier than when he was on the floor with some young children who had no idea who he was but were strangely thrilled by the presence of a special visitor.

In classic Dayton fashion, he finished up with the kids and then barraged the Republican opposition for not supporting still more school funding, even though it wasn't a budget year.

Despite their deep disagreements with him, Republican leaders like Gazelka and Daudt said they never doubted that Dayton thought he was doing the right thing for a place he clearly loves.

Dayton ended the recent interview by expressing hope that Minnesotans would appreciate the state's distinct status.

"While acknowledging the deficiencies that many people here in Minnesota are born into, still, it's an amazing place. We shouldn't take it for granted," he said. "We got it because we pulled together and we worked hard and we earned it. We can have our differences. And we will. But we should recognize our advantages and safeguard and enhance them. So that's my final message to the people of Minnesota."