The Democratic shift on gun rights has moved at light speed when compared with other political shifts.

In 2007, when Rep. Nancy Pelosi (D-Calif.) first claimed the speaker’s gavel, her majority was built from several dozen Democrats from rural areas who courted the endorsement of the National Rifle Association — and whose ranks swelled a couple of years later to give Democrats the largest congressional majorities of this century.

In the four years Democrats held the House majority, they never advanced a single significant gun-control measure. And in the eight years they controlled the Senate, Democrats held just one meaningful debate on reining in gun laws, in spring 2013. It ended amid a Republican filibuster.

But Tuesday, eight years to the day after she was shot and nearly killed, former congresswoman Gabrielle Giffords returned to the Capitol with Pelosi and Democrats back in charge of the House, fueled this time by dozens of newcomers who ran against the NRA.

Giffords endorsed legislation that would impose background checks on all gun sales and most gun transfers. The bill, numbered H.R. 8 to mark the anniversary of the shooting, is expected to easily pass the House in the coming weeks, the first of what promises to be several attempts to combat mass shootings and other gun violence.

“I’ve seen great courage when my life was on the line,” said Giffords, who survived the 2011 shooting that left six others dead at a congressional event outside a Tucson shopping center. “Now is the time to come together. Be responsible, Democrats, Republicans, everyone. We must never stop fighting — fight, fight, fight.”

She spoke alongside Pelosi and other leading gun-control advocates in the Rayburn Room, next to the chamber from which she retired in January 2012.

Later, Giffords, 48, walked onto the House floor with Pelosi and a few other Democrats supporting the bill to formally place it into the record. During the evening round of votes, Pelosi held a moment of silence for the anniversary of the shooting.

Giffords, back on the floor again, received an emotional standing ovation from both sides of the aisle.

Along with her husband, Mark Kelly, she helps run an organization to combat gun violence. An affiliated super PAC joined forces with other anti-gun groups, such as Everytown for Gun Safety, largely funded by Michael Bloomberg, and largely outspent the NRA and other gun rights groups during the past election cycle. They provided a political shield for Democrats who wanted to aggressively push measures such as background-check legislation and a ban on semiautomatic weapons.

These new gun-control efforts face an uphill climb to get enacted into law, given the Republican majority in the Senate and President Trump’s patronage of the NRA’s political operation. Republicans will continue to fight these proposals, noting that the Tucson shooter bought his gun legally.

“This legislation does nothing to prevent gun violence, yet threatens the constitutional rights of law-abiding citizens,” said Rep. Richard Hudson (R-N.C.), one of the NRA’s staunchest supporters.

But the shift in power will allow actual debates and actual votes on some proposals that have barely seen the light of day anywhere on Capitol Hill in the past 15 years.

This is certainly the most anti-gun House in at least 25 years, since the 1993 background-check law named after White House press secretary James Brady and the 1994 crime bill were signed into law.

Those two measures emerged from large bipartisan support — more than 45 Republicans joined more than 180 Democrats to pass each bill.

The final tallies for the new background-check legislation and other gun-violence bills are expected to come up with a similar range of about 235 to 240 votes.

But in this polarized era, all but a handful of the 235 Democrats are expected to support the background-check bill, led by Rep. Mike Thompson (D-Calif.), along with his five Republican co-sponsors and maybe a couple of other GOP lawmakers.

The Republican drift into the arms of the NRA has been well documented. The Democratic move to the left has been much more abrupt and will be on full display in the months ahead.

The GOP’s steady march to the right on guns began during the 1994 midterms, when Republicans won a landslide victory in the House in part by linking arms with the NRA to defeat Democrats who voted for the gun bills.

Republicans held the House majority for 20 of the next 24 years, and the only gun legislation that received consideration during that span had the backing of the gun rights lobby, mostly to expand the rights to purchase weapons.

In their brief hold on power last decade, House Democrats legislated in fear of the NRA and what it might do to those Democrats from rural districts. In 2008 and 2009, as Democrats tried to pass a law giving the District of Columbia voting representation in the House, the deal crumbled when dozens of House and Senate Democrats joined with Republicans to support an amendment that would have undermined D.C. gun laws.

D.C. officials asked Democrats to scuttle the legislation, not wanting to give up its ban on semiautomatic weapons, for instance, in exchange for a vote in Congress.

This decade, however, has seen a continued rash of mass shootings, with targets ranging from rural churches to suburban schools to urban bars.

That environment made it easier for Democrats to go after Republicans who were friends of the NRA and had blocked votes for gun control.

Take Reps. Lucy McBath (D-Ga.) and Mikie Sherrill (D-N.J.), both of whom won seats long held by Republicans in wealthy suburban districts.

McBath lost her son seven years ago to gun violence, and she has been an anti-gun activist in recent years. She won a seat outside Atlanta that Republicans had held since the 1970s.

“We will make our communities safer,” McBath said after Giffords spoke. “Quite simply, background checks save lives.

Sherrill, a former Navy helicopter pilot, is positioned as a moderate, having won a northern New Jersey district that stretches into exurban areas where hunting is common.

On Tuesday, Sherrill announced her first legislative act in office — she co-sponsored the background-check legislation.