The popularity of rap will soon be tested in a bellwether upstate congressional district.

Antonio Delgado, a former rapper turned lawyer who spewed politically provocative and racially charged lyrics a decade ago, is the Democratic nominee for Congress in the 19th CD upstate taking in the Hudson Valley and Catskills region.

Delgado, previously known as “AD The Voice” and who doesn’t explicitly mention his hip-hop exploits in his campaign web bio is trying to topple one-term GOP incumbent John Faso.

He put out an 18-song CD titled “Painfully Free,” in 2006, in which he frequently hurls the N-word, slaps the two-party political system, rips the “dead” presidents as “white supremacists,” blasts capitalism, likens blacks to modern day slaves, calls poverty the “purest form of terrorism” and boasts of “having sex to a porno flick.”

Delgado, a Schenectady native and Rhodes scholar with degrees from Colgate and Harvard Law, rants against injustice and lets loose on other issues, for example:

In a song titled “I Want,” he raps, “I wanna ride with my n—-s see them all get figures/I wanna see a righteous capitalist, if it’s possible for one to exist. ”

On another track he rhymes, “Dead presidents can’t represent me, not when most of them believe in white supremacy/like spittin’ on my ancestry.”

The song “N—-s?” includes the lyrics, “Look like we only goin’ from chains to cuffs, still n—s still locked up stuck on stuff.” In this song, he grapples with use of the “N” word but spews it repeatedly anyway. “I use the word n—a like I forgot the slaves owned,” he riffs.

In “SOS” he knocks the response to Hurricane Katrina, likening the Superdome used to house displaced residents as a “slave ship” and calling “poverty” the “purest form of terrorism.” He adds, “Why the response wasn’t as fast as 9/11?”

Still, his debut got a thumbs up in the hip-hop press.

“The album features hardcore hip-hop/rap numbers that tear into society hypocrisies and imperfections,” said a review in hybridmagazine.com,

The album notes from the music label Delgado co-founded said his sound is “fresh, sharp, political and spiritual — a cross between Tupac and Kanye West, with a touch of Nas.”

Delgado on Sunday defended his lyrics and said a socially responsible hip-hop artist can get elected to Congress.

“This is a willful and selective misreading of my work for political purposes. My music defies the same stereotypical notions that led you and whoever chose to share this music with you to immediately hear certain words and think they are bad or scary. If you listen to the content of the lyrics my mission is clear,” Delgado said.

“Any attempt to turn me into a right-wing caricature of a hip-hop artist is going to fail, because it’s not who I am and the voters in NY-19 have shown that they know better,’” added Delgado.

Former President Barack Obama carried the 19th congressional district in 2008 and 2012. But Republican Donald Trump came out on top there in 2016.

Faso won the open seat in 2016, defeating Democrat Zephyr Teachout.

Degaldo, 41, won a seven-way primary with 22 percent of the vote and now faces a broader electorate on Nov.6.

“This is truly a swing district that will be closely watched in New York and across the country. A lot of resources will be thrown in this race on both sides,” said Siena College pollster Steven Greenberg.

“Anything bad about either candidate will certainly come out.”