Former Virginia Congressman Tom Perriello speaks to the crowd during a rally announcing his candidacy for the Democratic nomination for governor of Virginia in Charlottesville, Va., Thursday, Jan. 5, 2017. Perriello, a favorite of progressives, will face off against Lt. Gov. Ralph Northam for the Democratic primary in June. (AP Photo/Steve Helber)

As a Democrat representing ­rural Virginia in Congress, Tom Perriello called the National Rifle Association the “epitome of ­people-powered politics” and won its endorsement. Now running for governor, Perriello on Friday blasted the gun rights lobby as a “nut-job extremist organization.”

Perriello has cast himself as a progressive fighter since he made an unexpected leap into the governor’s race last week.

He didn’t mince words Friday when a caller to a radio show asked about his past support from the NRA.

“Now they’ve really become a nut-job extremist organization, as I’ve called them before, that is much more interested in representing the gunmakers than responsible gun owners,” Perriello said on the “The Kojo Nnamdi Show” on WAMU (88.5 FM).

Perriello, who represented Virginia’s 5th Congressional District from 2009 to 2011, was running for reelection in 2010 when he received an A rating from the NRA and about $6,000 for his campaign. He signed on to a letter opposing the extension of the federal assault weapons ban.

After losing his seat, Perriello grew critical of the group in the aftermath of the Sandy Hook ­Elementary School shootings in Connecticut. In an open letter to Democrats this week, he urged Virginians to “stand up to an unhinged gun lobby.”

A spokeswoman for the NRA said Perriello is alienating voters.

“The fact that Tom Perriello thinks law-abiding citizens who value their constitutional right to self-protection are extremists shows how out of touch he is with Virginians,” Jennifer Baker said. “On Election Day, he is going to learn firsthand that voters are sick and tired of elitist politicians infringing on their freedoms.”

Lt. Gov. Ralph Northam, ­Perriello’s opponent in the Democratic primary, similarly criticized the NRA, which gave him a D rating in his 2013 race.

“The NRA went off the deep end long ago,” Northam, a former Army doctor, said in a statement. “Without question, they have been the biggest obstacle to enacting commonsense gun reform.”

Last year, Northam cast the deciding tie-breaker vote in the state Senate against a deal favored by the NRA and criticized by gun control groups that made it easier to carry concealed firearms in exchange for other restrictions. Similar bills later passed without him needing to vote.

Democrats vying for statewide office once treaded carefully around guns but have become vocal supporters of gun control. Gov. Terry McAuliffe (D) even bragged about his F rating from the NRA in his successful 2013 campaign.

Observers say Perriello’s past support for gun rights could be a liability among Democratic ­voters, particularly in Northern Virginia. “He’s decided, ‘I’m better off saying I changed my mind rather than trying to cater to the small group of rural voters who would participate in the Democratic primary,’ ” said Bob Holsworth, a longtime political analyst.

On Nnamdi’s show, Perriello said he believed the Second Amendment protects the right to bear arms. But he said he no longer recognizes the NRA that arranged target practices and gun safety courses at the camps he attended growing up in central Virginia. Echoing Ronald Reagan’s disavowal of his days as a Democrat, Perriello said that he didn’t leave the NRA but that the NRA left him.

His spokeswoman said Perriello was unavailable Friday for an interview. In a statement, he said he would work as governor to restrict access to guns with “no defensible role in sport or home-defense.”