When Plan B debuted the video to his new single Ill Manors over the weekend, shadow health minister Jamie Reed MP tweeted: "The risk of any lefty politician being pilloried for praising the new Plan B track is really pretty high. That said, it's excellent." He was correct on both counts. For lovers of overtly political music Ill Manors is almost too good to be true: a thrilling release from a multi-platinum star that deals unflinchingly with last summer's riots and still lands on the Radio 1 playlist – the first great mainstream protest song in years. What's the catch?

What convinced me there wasn't one was the interview Plan B (born Ben Drew) gave 1Xtra presenter Mistajam. Far from just ringing the doorbell and running away, the rapper is fully prepared to expand on the single's ideas. "I genuinely want to change things," he said. "This is just the first step. Let me make my point first and raise the issue, and then if anybody wants to talk to me about how I think we can change these things I'm ready." An album and film, both called Ill Manors, are set to follow, along with plans for social activism. He's in this for the long haul.

Jamie Reed tweeted that Ill Manors "really does remind of What's Going On", but it's different in two crucial respects. Marvin Gaye was, by 1971, an established soul star observing the Vietnam war and inner-city deprivation from a distance; Drew still sounds like the product of a turbulent environment in north-east London. And Gaye's response to turmoil was transcendent, healing beauty; Ill Manors, which resembles hip-hop produced by the Prodigy, reflects the raging unease of its subject matter. It has more in common with Public Enemy or the Clash: music that addresses a riot and sounds like a riot. "As an artist who's trying to convey a message I need to get under people's skin," he told Mistajam. "The song needs to have that visceral energy … just like those horrible pictures we see on cigarette packets that are designed to shock us into being aware of our actions." (It's based, incidentally, on Peter Fox's 2008 German hit Alles Neu, which in turn samples Shostakovich's Seventh Symphony).

Having got the listener's attention, the song offers a dense and thorny lyric, full of unresolved contradictions and abrupt changes of subject. Solid liberal-left talking points – the closure of community centres, the adverse impact of the Olympics on London's poor – spiral into jokes and threats. Although he briefly mentions Boris Johnson (in reference, oddly, to the congestion charge introduced by Ken Livingstone), Cameron and Clegg appear only in the remarkable video, the work of Top Boy director Yann Demange. It's partly about the riots, and the government is in the background, but mostly it's about the psychology of class. You'd have to go back to the mid-90s, with Common People and A Design for Life (both of which were, in part, reactions to the perceived proto-chav mockery of Blur's Parklife), to find equivalently complex treatments of class in mainstream British pop.

Drew has said of his family: "We weren't working class but we weren't middle class, we were in the void in-between." The critic Simon Reynolds has described this as the socially precarious, creatively fertile "liminal class", which produced many of punk's prime movers. These days most members of that class fall under the dismissive umbrella of "chav". 1Xtra again: "For me that term is no different from similar terms used to be derogatory towards race and sex, the only difference being that the word chav is used very publicly in the press … When you attack someone because of the way they talk, the way they dress, the music they listen to, or their lack of education, and you do it publicly and it's acceptable to do that, you make them feel alienated. They don't feel like a part of society … For every person who uses the word chav there is a less educated person ready to embrace it. They say, well, look, I'm never going to change the way you think of me so actually I'm going to play up to it and fuel the fire. In essence that's what Ill Manors is about."

With less talent, or worse luck, there's a chance that Drew could have been among the rioters last summer, which is what gives Ill Manors both insight and nervous energy. On his stark 2006 debut, Who Needs Actions When You've Got Words, Plan B described his experiences and those of the people who lived around him. After the hugely successful lyrical and stylistic detour of The Defamation of Strickland Banks, he's returned to that terrain with a keener understanding of the political context. The social alienation, the fire-fuelling and the self-destructive lashing out all played a part in his own adolescence. The frustration he has expressed towards his younger self is now directed at the rioters. "I'm not trying to condone what happened during the riots," he told 1Xtra. "It disgusted me. It made me sick. It saddened me more than anything because those kids that was rioting and looting they've just made life 10 times harder for themselves. They've just played into the hands of what certain sectors of Middle England think about them."

Ill Manors says if you stereotype people as socially worthless then they will grow into those stereotypes. "Think you know how life on a council estate is from everything you've ever read about it or heard?" he asks. You expect a rebuttal, but instead: "Well it's all true, so stay where you're safest there's no need to step foot out the 'burbs." Drew writes best about being cornered – even his hit album is about a soul singer in jail – and here, playing a non-famous version of himself, he's cornered by prejudices he finds easier to confirm than overcome. Every rapid-fire verse accelerates with increasing desperation towards the same illicitly exciting chorus: "Oi! I said oi! What you looking at, you little rich boy?" The mingling of despair and defensive pride recalls A Design for Life's chorus: "We don't talk about love, we only want to get drunk."

The inhabitants of Ill Manors are in a lose-lose scenario. They riot: they're trapped. They don't riot: they're trapped. At least one way they get to feel for a moment the illusion of empowerment. Drew doesn't celebrate or even forgive that response but he attempts to explain it. Furthermore, when Demange cuts from a staged car-burning to news footage of the real thing, the viewer gets a disconcerting taste of an aspect of the riots that liberal analyses tend to downplay: the fact that wanton destruction can be briefly cathartic and, whisper it, fun. It reminds me of Greil Marcus's description of the Rolling Stones' Street Fighting Man as "a challenging emotional jigsaw puzzle, not congratulations for being on the right side".

So is Ill Manors really as good as it at first seems? No. It's much better.