LANSING, Mich. — For the first time in 40 years, a legislative session began in Michigan last week with a Democratic governor, Democratic control of both the House and Senate, and a plausible path for decades’ worth of liberal policy goals to become law.

Within hours of being sworn in, Democrats in the Legislature announced plans to codify L.G.B.T.Q. rights, repeal an abortion ban that is unenforceable but still on the books, and get rid of a so-called right-to-work law loathed by labor unions.

The new Democratic power in Michigan comes as the party will also take charge in Maryland, Massachusetts and Minnesota, restoring Democrats’ control of statehouses to a level not seen since 2009, during the first months of Barack Obama’s presidency.

Democrats will have a so-called trifecta — control of the governorship and both legislative chambers — in 17 states, according to data from the National Conference of State Legislatures and Ballotpedia. That is still fewer than the 22 states where Republicans have full control, but it is a major comeback from a lost decade for state-level Democrats, who were bludgeoned in the 2010 and 2014 midterms and, as recently as 2017, had sole control at only six capitols. Slightly more people will now live in states with full Democratic control than in those with full Republican control.

“Democrats just cannot implement their vision for this country and the future without state legislative majorities,” said Heather Williams, the executive director of the Democratic Legislative Campaign Committee, which has focused on rebuilding the party’s influence in statehouses.

What remains untested, though, is whether Democrats can or will wield their newfound authority with the same unflinching force that Republicans exerted over the last decade, when they cemented control of once-competitive states like Arkansas, Indiana and Ohio and turned even swing states like Michigan and Wisconsin into laboratories of conservative policy.

Complicating Democrats’ ambitions in Michigan and Minnesota, especially, are narrow legislative majorities that leave little room for intraparty dissent at a time when their supporters expect a broad display of significant liberal lawmaking.

“Because you have in many instances 30, 40 years of pent-up policy, I think there are many groups and organizations who want everything done immediately,” said State Senator Sam Singh, a member of Democratic leadership in Michigan. But, he added, “there’s only so fast a legislative body can work.”

Michigan Democrats benefited in the midterms from new district boundaries that were drawn by a nonpartisan commission, as well as from a constitutional amendment on abortion rights that passed overwhelmingly and helped drive liberal-leaning voters to the polls.

Winnie Brinks, the Democratic leader in the Michigan Senate, said the new majorities allowed her party “to go a little bit deeper and not just take crumbs” on issues like increasing an earned-income tax credit.

Across the country, both parties have long used state government as a testing ground for ambitious new laws, including ones that would stand little chance of passing in Congress. After Donald J. Trump became president, California Democrats used their control of the governor’s office and Legislature to aggressively counter his administration. And when Republicans swept into power at state capitols after the 2010 elections, they quickly remade states in a conservative image, sometimes within weeks or months.

In Wisconsin, despite large and sustained protests, Republicans moved rapidly to cut collective bargaining rights for most public employees. They also overhauled the state’s approach to taxation, education and government spending, and passed gerrymandered redistricting maps that diluted Democratic influence in the Legislature and limited the ability of Gov. Tony Evers, a Democrat who was elected in 2018 and 2022, to counter trifecta-era laws.

Scott Walker, the Republican who oversaw Wisconsin’s shift to the right during eight years as governor from 2011 to 2019, said many of his most significant accomplishments came at the beginning of his tenure. Politicians freshly entrusted with power, he said, can build goodwill with voters by moving quickly to fulfill campaign promises.

“As a Republican, I’m not thrilled about the idea of Democrats doing the things that they campaigned on, whether it’s in Michigan, Minnesota or anywhere else,” Mr. Walker said. “But I think in general if they follow our pattern — that is, you do the things you say you’re going to do — there’s at least going to be a certain amount of, particularly, swing voters who will say, ‘I didn’t agree with everything, but they did what they said they were going to do.’”

In Maryland and Massachusetts, which are dependably Democratic in presidential races, Democrats claimed trifectas, succeeding moderate Republican governors who were not running for re-election. In Minnesota, where Democrats flipped the State Senate to claim legislative control after eight years of divided government, lawmakers have already advanced bills this month that would enshrine abortion rights in law, legalize recreational marijuana and allow undocumented immigrants to get driver’s licenses.

“There’s a lot that’s really teed up and ready to go,” Melissa Hortman, the speaker of the House, said in an interview shortly before the Minnesota session began. She added: “The blocker has been removed.”

But Ms. Hortman knows firsthand how temporary legislative control can be. She served in the Minnesota House a decade ago when Democrats held all three levers of power for two years, a period in which they legalized gay marriage and medical marijuana.

“We knew there was political risk in doing bold things,” Ms. Hortman said. “But the reason why you run and the reason why you want to win is so that you can do things.”

While Democrats celebrate their midterm performances, the losses have led to some soul searching among Republicans, who, despite setbacks in November, still have trifecta totals that are close to their modern-day highs. The number of states with full Republican control can be counted between 21 and 23 depending on whether that total includes Nebraska, where the unicameral Legislature is officially nonpartisan, and Alaska, where Republicans make up a majority of lawmakers but do not all caucus together.

Though a Republican victory in the Nevada governor’s race ended a Democratic trifecta and brought in divided government, Democrats gained a foothold in Arizona by flipping the governorship.

In Michigan, State Representative Andrew Beeler, the assistant Republican leader in the House, described the day after the election as a “bucket of cold water in the face” for his caucus.

“I think we all woke up that morning and said, ‘We never saw this coming, and we’re never going to get surprised again,’” said Mr. Beeler, 30, who was not born the last time Democrats held a trifecta in his state.

Mr. Beeler said that there was openness among Republicans to working in a bipartisan way on some issues, including on tax cuts Democrats have proposed, but that he expected his caucus to be unified in opposition on certain social issues.

Mr. Beeler said he doubted Democrats could muster the votes to repeal a right-to-work law, under which workers cannot be forced to pay union dues or their equivalent. That law, a signature policy of Republicans a decade ago when they had full control, led to tense protests in a state with a long history of union labor.

Democrats in Michigan said they had studied trifectas in other states, including Virginia, where a fleeting period of Democratic control ended in the 2021 election, and Illinois, where Democrats have enacted a series of far-reaching policies on abortion, guns and spending since seizing full control in the 2018 election.

Gretchen Whitmer, Michigan’s Democratic governor, said in an interview that her party’s two-seat majorities in both chambers were not an overarching mandate from voters as much as they were an “affirmation that we’re focused on the right things.”

“It’s a big deal — I don’t want to imply that it’s not,” said Ms. Whitmer, who has built a national profile since taking office in 2019 and who convincingly won a second term in November. “But it’s also, I do think, a solid reminder that Michigan is a state with lots of people who have very different views.”

But for 40 years’ worth of Michigan Democrats who toiled in divided or Republican-controlled governments, the chance to press for long-desired policies has brought a new level of possibility to their work.

State Senator Rosemary Bayer, a Democrat whose previous district included Oxford High School, the site of a 2021 mass shooting, said she expected lawmakers to soon consider bills that would expand background checks for gun buyers, toughen penalties for adults who leave firearms accessible to children and create a red-flag measure for guns to be seized from people deemed dangerous.

“We’re really trying hard to work as a group,” she said, “to work together on a strategy that will give us our turn at the 40 years.”