Madame Sata: Drama. Starring Lazaro Ramos. Directed and written by Karim Ainouz. (Not rated. 105 minutes. In Portuguese with English subtitles. At the Opera Plaza, Shattuck in Berkeley and Towne in San Jose.)

Born to ex-slaves, demeaned as a poor, black homosexual, Joao Francisco dos Santos didn't grovel for the respect that he saw as his birthright. He demanded it, he fought for it -- loudly, righteously, violently.

Denied access to a posh Rio nightclub, dos Santos attacked and bloodied the bouncer, beating him to the ground. When a drunk castigated him with racist and anti-gay slurs, he followed the man onto a dark street and, trembling with rage, shot him in the back.

In his thrilling feature debut, "Madame Sata," Brazilian filmmaker Karim Ainouz doesn't glorify dos Santos but examines the hot, reckless fever of his life in all its thorny complexity. Played by Lazaro Ramos with urgent, explosive physicality, dos Santos emerges a symbol of resistance.

Born in 1900, 12 years after slavery was abolished in Brazil, dos Santos spent 27 of his 76 years in prison. Six feet tall and coal black, he was a female impersonator (Madame Sata was his drag persona), a street scrapper, a brothel cook, gangster, prostitute, adoptive father and friend to pimps, whores and misfits in Rio's low-rent Lapa district. He idolized African American chanteuse Josephine Baker, and alternately called himself the Shark, the Wild Pussycat, the Queen of the Forest, Saint Rita of the Coconut Tree, and Negress of the Bulacoche.

A fascinating collision of male and female, dos Santos could brawl like a demon -- legs flying in fierce capoeira kicks, face fixed in a Maori warrior's battle grimace -- and turn dainty, ultrafeminine the next. We see him standing in the wings of a cabaret, lip-synching to a diva's sweet lament; later, he hugs his arms around his shoulders, like a spooked, defenseless maiden, whispering "I hate violence."

Ainouz, who lived in New York in the '90s and worked as assistant to Todd Haynes, first heard of Madame Sata in the '80s, when he frequented a punk nightclub by that name in Sao Paulo. "Madame Sata," based on a biography of dos Santos and a series of interviews that Ainouz conducted, peels away at the elaborate, self-fulfilling myths that dos Santos created about himself -- and offers a portrait that's rough, startling in its intimacy, drained of sentiment.

"There's something eating me up inside," Joao says to his roommate and best friend, Laurita (Marcelia Cartaxo) when she asks why he doesn't "calm down."

"It's like you're angry for being alive," she adds.

"Maybe," he replies. "It's like an anger without end."

Ainouz directs in a loose, jumbled style that captures in filmic terms the wild tumult of dos Santos' life. Scenes spill out in nonlinear vignettes that seem not to connect. It's disorienting at first, but appropriate to the life of a man who never walked a straight line, in any sense of the word, but caromed and crashed from one extreme to the next.

Photographed by the brilliant Walter Carvalho ("Central Station"), "Madame Sata" is lush, impressionistic, full of shimmering golds, coppers and ochres. The images, similar to those in "Seven," were refined through "bleach bypass," a film-development process that results in sharp contrasts -- capturing in this case a mystery, an erotic steaminess, smoke and sweat, a time and a sensibility that's past.

Dos Santos approached his life like a kamikaze fighter, but given the country and the time in which he lived -- when gays and blacks were conditioned to hate themselves, and never expect full citizenship -- dos Santos not only declared his worthiness, but fought like a caged tiger to seize it. It was a life of tragedy, of scorching chaos, but it was ultimately heroic.