You build political power by beginning at the bottom.

That’s one of the hopeful lessons of the elections on Tuesday that saw progressives, socialists, and other leftists sweep into office at the local and state level all over the country. It was an election in which the progressive “farm team,” the “pipeline”—whatever metaphor you please—became bigger and better and stronger.

This farm team has been weak on the left for decades; in some places, it has barely existed. But on November 7, as voters headed to the polls during what might traditionally have been dismissed as a low-stakes year, they not only staged the first electoral repudiation of Donald Trump, but they also seeded the local soil with promising talent. These fresh new pols now have a chance to make real change in their home cities and states: to fight for housing as a human right, rent control, higher taxes on the rich, stronger environmental protections, and an end to mass incarceration and the war on drugs. Just as crucially, some of them might eventually choose to keep going in politics, winding their way from school boards and city councils toward higher office.

“There are no shortcuts to building power,” says Sarah Johnson, the co-director of Local Progress, a network of progressive local elected officials across the country. “The election results from Tuesday really show the beginning of a ground-up movement that we are going to see in next year’s election and for years to come as more and more people, inspired to activism in this moment, are taking it to the next level and running for office.”

But how exactly do you build power? And what is the alchemy that catapulted many of these first-time candidates, like Danica Roem, Ravi Bhalla, and Phillipe Cunningham, into city halls and statehouses across the country?

One place to look is Somerville, Massachusetts, a city of roughly 80,000 just outside of Boston. Last spring, a group of young people in the city formed a chapter of Our Revolution. They were outraged over Trump’s election and inspired by Bernie Sanders’s social-democratic vision, and they wanted to take power into their own hands.

They decided to dive into electoral work straight away—and they felt like they had to start at the ultra-local level, where elections were imminent. They recruited or endorsed a slate of seven leftist candidates to run on a joint ticket in the city’s Board of Aldermen elections this year. And then they did the real work. According to Penelope Jennewein, a 25-year-old organizer with Our Revolution Somerville, the group’s dozens of volunteers knocked on 300 doors a week for 11 weeks straight, right up until Election Day.

“We talked about economic justice, affordable housing, and tenants’ rights,” among other issues, says Jennewein. “And now I think it is fair to say that the balance of power on the Board of Aldermen has completely changed. It has swung to the left.”

This is, if anything, an understatement: All seven of the group’s chosen candidates were elected, and they now dominate the 11-member board. The new aldermen include Will Mbah, a recent US citizen who immigrated from Cameroon in 2010, and two members of the Democratic Socialists of America (DSA), JT Scott and Ben Ewen-Campen. Among other issues, they hope to promote the use of community land trusts in the city and enshrine a tenants’ right of first-refusal—both as a means of protecting affordable housing.

“It is a shock,” says Jennewein. “I didn’t think we were going to have this many victories.”

Progressives also ran the table in Lancaster, Pennsylvania, where more than a dozen Democrats, many of them young and populist in outlook, won resounding victories in both the diverse liberal-leaning city and in its deep-red suburbs.

“It is so great,” says Eliza Booth, an organizer with Lancaster Stands Up, a local grassroots group founded by former Sanders campaign staff and volunteers. “We feel energized. Our base feel energized.”

And it should. Lancaster Stands Up worked tirelessly in the months leading up to the election, beginning as early as last spring, and not only endorsed all of the victorious Democrats but also registered voters and canvassed continuously in the lead up to the election. The group’s long-term goal is to unseat Republican Congressman Lloyd Smucker in the 2018 mid-term elections, and Tuesday’s outcomes were a promising portent.

Consider the township of Manheim, a wealthy community that sits just outside Lancaster’s borders and where Democrats make up only 30 percent of all registered voters. Despite their serious underdog status, Democrats won all six open School Board seats, completely routing their opponents. They also picked up two seats on the Township Board of Commissioners. It was a major realignment in the political makeup of the area, says Nick Martin, a former field organizer for the Sanders campaign who now works for Jess King, a populist Democrat taking aim at Smucker’s seat.

“It is unprecedented. It is a really big deal,” he says. “I would call it a sign of what is possible.”

Indeed, Booth says Lancaster Stands Up is already mobilizing for next year’s big electoral face-off .

“We want to flip our congressional district blue in 2018, and get Lloyd Smucker out of there,” she says, of a district that has been held by Republicans for all of living memory. “That is our goal and that is what we are focused on. And we are moving in that direction.

There’s a common thread running through these victories: intensive organizing, combined with pavement-pounding, door-knocking and all the slow, steady labor that building power requires. Often the organizing took place under the aegis of Our Revolution, DSA, or the Working Families Party, but there were also instances, as in Lancaster, where activists came together on their own terms, in their own hyper-local organizations, to take back their cities. And these terms were significant. While the 45th president may have loomed large and threatening in the background of many campaigns, they weren’t just narrowly drawn reactions to Trump and Trumpism. They didn’t stop at “NO!” Rather, they were grounded in an affirmative politics, offering tangible ideas and real solutions to the problems plaguing their communities.

One clarion example was Larry Krasner, a longtime civil-rights attorney and movement lawyer, who pulled off a landslide victory this week to become Philadelphia’s next district attorney. In a major showing of progressive muscle, he won approximately 75 percent of the vote after a campaign that featured strong stances against the death penalty, cash bail, mass incarceration, and the criminalization of addiction. In his victory speech, Krasner said he would bring “transformational change” to a prosecutor’s office with 600 staffers and a $54 million budget.

As in Lancaster and Somerville, Krasner’s victory was not his alone. He had the backing of numerous grassroots organizations that worked tirelessly to get him elected. Of particular importance, he says, were the Pennsylvania Working Families Party and Reclaim Philadelphia, a group that grew out of the Sanders campaign. Both organizations ran serious ground games on his behalf, canvassing across the city for months. It was the sort of traditional meticulous outreach that makes or breaks local electoral campaigns. And the outcome speaks for itself.

“If you look at the last three election cycles for DAs in Philly you will see the total number of votes cast was in the range of 120,000 to 130,000 and the votes in our election were around 200,000 votes,“ Krasner says. “You are looking at an incredible spike.”

“The mainstream Democratic Party—and I am Democrat—really needs to wrap its loving arms around progressives,” he adds. “Republicans should be shaking in their boots because it is clear that for a long time there has been a big group of voters that would not get out to vote because they weren’t excited by their options.”

When you give people a bold progressive option, on the other hand, “they will beat down the doors to go vote.”

It was a gleeful Tuesday for progressive contenders in the Twin Cities, too.

In Minneapolis, voters elected to the city council Phillipe Cunningham, a black transgender man who ran on a campaign that proclaimed housing a human right, denounced environmental racism in the city’s northern neighborhoods, and promised to hold regular “office hours” in the community. They also elected Andrea Jenkins, a black transgender woman who built her campaign around a call for equity in housing, public safety, the arts and other crucial concerns. Jeremiah Ellison, the son of progressive champion Representative Keith Ellison, took a seat on the council too. Meanwhile, although socialist Ginger Jentzen ultimately lost the race for the Third Ward City Council seat, her calls for higher taxes on the rich, rent control, and an end to both corporate welfare and stop-and-frisk style policing brought her tantalizingly close.

St. Paul, meanwhile, elected its first African-American mayor, the 38-year-old Melvin Carter III. Carter ran on a platform that emphasized police reform and a $15 dollar minimum wage, among other issues.

“The progressive wave on the City Council in Minneapolis is so exciting,” says Johnson, of Local Progress. “Minneapolis is a perfect example of a city that has seen tremendous progressive change over last few years, between paid sick leave and the successful fight for $15. It has had a really robust progressive agenda at the local level, and the election results are a clear and ringing endorsement of that agenda.”

And the victories were not all confined to the eastern side of the 100th meridian. In Las Cruces, New Mexico, a city of 100,000 on the edge of the Chihuahuan desert, progressives won every race in the municipal election on Tuesday. Three left-leaning Democrats were elected to the City Council, while the council’s sole remaining Republican lost her seat.

Gabe Vasquez, a 33-year-old conservationist and staffer with the New Mexico Wildlife Federation, was one of the victors.

Vasquez, who knocked on nearly a thousand doors during his campaign, says he was inspired to run for office “to insulate Las Cruces from the effects of the Trump administration.”

After Trump’s election, he says, “I wanted to make sure that I protected the values and the culture of our people here. I felt a calling to step up for my community.”

He says his platform mostly focused on local concerns: bringing investment back to the older and historic parts of Las Cruces, funding more art and cultural programs in his community, and creating a more equitable economy for his low-income and largely Latino constituents. But, along with other progressives in the city, he also made the Trump administration’s attack on public lands an issue.

For the last six months, the White House has been working to gut one of our country’s oldest conservation laws, the 111-year-old Antiquities Act, which allows presidents to create national monuments. Such monuments are protected parcels of public land where development and commercial use are heavily restricted or prohibited outright. President Obama created a monument just outside of Las Cruces, the Organ Mountains–Desert Peaks National Monument, and the Trump administration has threatened to weaken protections for that land. Vasquez says it is heedless attacks on popular institutions like these that have turned people against the president and his party.

“Communities around the country are clawing back their values,” says Vasquez, “and that will continue as long as Mr. Trump undermines the populace.”

Finally, briefly, to Montana, that last best place with a long history of left-wing politics. Helena, the state capital, saw a progressive revival as well this week. Voters there elected Wilmot Collins as their next mayor. Collins is a 54-year-old who came to Montana as a refugee more than 20 years ago after fleeing the Liberian civil war. Focusing on affordable housing and teenage homelessness, he ran his campaign as part of a progressive slate alongside two candidates for the city commission, Andres Haladay and Heather O’Loughlin.

All three prevailed.