Several months ago, walking past Cambridge City Hall, I was surprised to find myself teary-eyed. Ten years ago — May 17, 2004 — a simple but profound event took place there. For the first time in American history, same-sex couples were granted marriage licenses and treated as equals under the law. That simple act, and the campaign that so many of us in Massachusetts built and executed, energized a national movement that is now driving rapidly towards the Supreme Court for national resolution that could happen as soon as next year.

A decade later, the campaign that protected the freedom to marry in Massachusetts holds lessons for the rest of the country.

In the months leading up to May 17, 2004, we had been battling in the State House to fend off a constitutional amendment that would strip away the marriage equality granted by the state’s highest court. At the same time, lawyers at Gay & Lesbian Advocates & Defenders (GLAD) were swatting down lawsuits to stop the marriage ruling from ever going into effect. But by May 16, the fighting came to a pause, and hundreds of couples stood in line in front of the Cambridge City Hall to collect their marriage licenses at 12:01 the next morning.

I will never forget the electric scene that evening as thousands of well-wishers joined the couples, first to wait and then to erupt in celebration. And that was just the beginning. A gorgeous spring morning awaited hundreds more on Boston City Hall Plaza the next day, when couples emerged with gigantic smiles, holding up their licenses for all to see. The hundreds of onlookers, gay and straight, cheered every single time. When the first plaintiff couple married, Mary Bonauto, the relentless GLAD attorney who won the lawsuit, could not stop crying in the pews of the Arlington Street Church.

Today, 59 percent of Americans support the freedom to marry, which is now the law in 17 states and the District of Columbia. In just the last year, we’ve had 12 consecutive victories in federal court, following the Supreme Court’s historic ruling that ended the discriminatory Defense of Marriage Act. Even if we haven’t yet won the whole thing, we are heading in the right direction.

But 10 years ago, it all seemed very fragile, the outcome uncertain. Our opponents gathered the required signatures, and we faced three years of unrelenting battles in the State House to block a constitutional amendment that would take marriage away from making its way to the ballot. We knew we had to contain the fight; a ballot campaign would unleash every ugly stereotype, and losing Massachusetts would be a tremendous setback in the larger quest to win nationwide.

Our opponents were organized, well-funded, and loud. The Catholic hierarchy mobilized as it hadn’t for years; Governor Mitt Romney was burnishing his conservative credentials by railing against the court ruling and supporting a ballot measure; President George W. Bush was advocating for a federal constitutional amendment; and the well-financed national religious right aimed everything at stopping our marriages.

Back then, we couldn’t count on many Democrats either. In the midst of a presidential run, our US senator, John Kerry, called for civil unions instead of marriage and supported a state constitutional amendment to undo the decision. So did the Senate president and House speaker.

We knew we had to move swiftly and strategically. Over those three years of legislative maneuvering, we built a movement that switched nearly 100 lawmakers (or their replacements) to marriage supporters. Finally, on June 14, 2007, we beat back the constitutional amendment by a vote of 45-151, holding our opponents beneath the required 25 percent threshold to move the amendment to the ballot.

Of all the approaches we employed in Massachusetts, two have been most crucial to our national successes.

First, we organized committed same-sex couples to make their case directly to their lawmakers. We knew the best way to undermine our opponents’ hostile portrayal of our lives was to have lawmakers learn why marriage mattered to their gay and lesbian constituents and their families.

This was not easy. Over the three-year period, MassEquality hired close to 100 organizers, and one of their key assignments was to to find married same-sex couples in key legislative districts, convince them to talk with their elected representatives, and coach them on how to do it.

One couple, Deb and Sharon, lived in rural Worcester County. Despite their trepidations, the couple stepped up to the task, meeting first with their state senator, and then spending several months working to turn their two state representatives. When the final vote was tallied, and all three of those rural lawmakers rejected the constitutional amendment, their senator, Steve Brewer, remarked, “Who said two people couldn’t make a difference?” The brave work Deb and Sharon did was repeated across Massachusetts — and wherever state legislatures took up the issue, from New York to Washington state and more than a dozen states in between.

A second important Massachusetts lesson was simple: If you want to win, re-elect your friends, and make examples of a few of your opponents by defeating them. Many lawmakers believed, with good reason, that voting our way would be a career-ending vote. When the Vermont Legislature approved civil unions in 2000, 17 supporters were defeated. Our opponents promised a campaign to “make them remember in November,” and Governor Romney was seeking to defeat every possible Democrat and replacing them with Republicans who, nearly to a person, were against us. MassEquality and its backers recognized and met that challenge. In 2004 and 2006, 195 candidates who had voted our way faced re-election, and they won every single race. What’s more, we helped defeat four incumbents who voted against us.

Rigorous electoral work has become a crucial element of our movement’s work nationwide, spearheaded by gay philanthropist Tim Gill and joined by dozens of other donors. We’re now known nationally as a movement that goes to the hilt to protect our friends and take out opponents who stand in the way of our equality.

No strategy or approach would be effective if our cause didn’t embody the best of American values. Yet today’s success was never inevitable. It has taken a great deal of hard work. Much of that work began one decade ago in Massachusetts, when the freedom to marry first became real.

Freedom to Marry was the campaign to win marriage nationwide. With the Supreme Court victory on June 26, 2015, the work of this strategic campaign – though not the larger movement – was achieved, and Freedom to Marry wound down its operations, closing in early 2016. For inquiries, please email legacy@freedomtomarry.org.