Public opinion on guns seems to be going in the same direction as it did on same-sex marriage. The religious right lost the fight against same-sex marriage. The gun lobby may lose the fight to stop reasonable gun-control laws.

Over the past 10 years, the United States has seen a complete reversal of public opinion on same-sex marriage — from opposition to support. This month, a Gallup poll press release was headlined, “Americans’ Desire for Stricter Gun Laws Up Sharply.”

The turning point on guns came in 2013, when the Senate filibustered a bill that would have closed the “gun show loophole” and mandated background checks for all gun purchases. About 90 percent of Americans support universal background checks. After the Senate bill failed, public support for stricter gun laws shot up to 58 percent from 44 percent a year earlier.

In the case of same-sex marriage, the shift of opinion was driven by personal experience. More and more Americans say they know someone — a relative, a friend, a coworker — who is openly gay. The shift on guns is being driven by mounting outrage over the country’s inability to keep guns out of the hands of deranged individuals.

“The political calculus has changed,” said the president of Everytown for Gun Safety, a lobbying group.

Six states have passed background check legislation since 26 people, including 20 small children, were killed by a gunman at the Sandy Hook Elementary School in Newtown, Connecticut, in 2012. One passed in Washington state last year by popular vote. In New Jersey recently, the state Senate, for the first time, mustered enough votes to override a veto by Republican Governor Chris Christie. The vote upheld a New Jersey law requiring that the courts be notified of any request to expunge mental-health records of people attempting to acquire a gun.

State laws won’t mean much, however, as long as people can purchase guns in one state and take them across state lines. Advocates of stronger gun controls are hoping the momentum is building for action in Washington, just as it did in the case of same-sex marriage.

But the two issues are different. The ultimate victory for same sex-marriage came when the U.S. Supreme Court ruled in June that same-sex marriage is a constitutional right. A same-sex marriage law never had to be passed by Congress.

Getting a gun law through Congress is difficult because of single-issue voting by gun-rights supporters. If you are a legislator and you know that a majority of your constituents favor a new gun law, you also know that it would be risky to support such a law. Why? Because you would lose votes from the minority who would vote against you for that reason alone. They would likely outnumber those who would come out to support you for that reason alone. Most people who favor gun laws don’t care so intensely about the issue that it drives their votes.

President Barack Obama is trying to change that.

Following the shootings on a college campus in Roseburg, Oregon, this month, the president urged people who want to see stronger gun laws to become single-issue voters. “Here’s what you need to do,” Obama said at a press conference. “You have to make sure that anybody that you are voting for is on the right side of this issue.” And if they oppose new gun laws? “Even if they’re great on other stuff, you’ve got to vote against them.”

In other words, let the gun issue drive your vote.

Gun-rights activists do that all the time. They make sure legislators know they will be punished if they vote for new gun laws. For supporters of gun control, however, guns are not usually the sole voting issue.

In fact, Obama quickly undermined his own appeal when he compared gun laws to the conservative effort to shut down the federal government unless Planned Parenthood is defunded. “You can’t have an issue like that potentially wreck the entire U.S. economy, any more than I should hold the entire U.S. budget hostage to my desire to do something about gun violence,” Obama said. “That would be irresponsible of me.”

The problem is that gun-rights activists, like many anti-abortion activists, don’t care about being “irresponsible.”

Things may be changing, however. Most of the gun lobby’s power is over Republican legislators in one-party districts, where they can punish waverers in low-turnout primaries. Democrats are not so easily intimidated, particularly if, as is increasingly the case, they represent strongly Democratic constituencies.

More broadly, the gun issue has become a clear demarcation between the New America coalition that defines the Democratic Party today — minorities, working women, young people, educated professionals — and the Old America that defines the Republicans. The New America constituencies are growing. The Old America is not.

Moreover, the Republican Party is tearing itself apart, while the Democratic Party is coming together around stronger gun regulation, as presidential candidate Hillary Clinton has found out. This is one key area where she outflanks her strongest opponent, Senator Bernie Sanders (D-Vt.). She has declared war on the National Rifle Association. “This has gone on too long,” Clinton said at the CNN debate. “It’s time the entire country stood up against the NRA.”

The public consensus on guns is changing. It’s not happening as fast as it did on same-sex marriage. But it is happening. And Democrats, who feel increasingly safe from gun lobby threats, are ready to act.

In the past, opponents of stricter gun laws could peel off a few Democrats who got elected in rural and conservative areas. There are not many of those Democrats left. Now supporters of stricter gun laws are finding they can peel off Republicans whose suburban constituents are increasingly horrified by gun violence.