The Rio de Janeiro of City of Men is a jigsaw puzzle of shacks and run-down bungalows, snaking up the hills away from the high-rises looking out over the sun-splashed bay. It's a place where armed gangs are the rule of law, and there really is no rule of law - just Wild West-style shoot-outs, and people caught in the cross fires, ducking for cover.

Directed by Paulo Morelli, and adapted from a popular Brazilian TV series, City of Men is set in the same shantytown neighborhoods, the favelas, of Fernando Meirelles' 2004 Oscar-nominated City of God. Meirelles produced City of Men, too, but while the locales and the drug-dealings are the same, Morelli's picture has a different point of view: It's about two childhood friends, Acerola, or "Ace" (Douglas Silva), and Laranjinha, or Wallace (Darlan Cunha), growing up, trying to survive, amid the anarchy and violence all around them.

In many ways, City of Men is like a Portuguese-language version of David Simon's The Wire: It's about kids, young men and women, born in an environment of rampant crime and killing, attempting to get on with their lives, looking for friendship and family.

Ace is grappling with fatherhood: Not yet 18, he has a little boy, while the mother, herself a teen, is preparing to leave town altogether. Wallace, likewise just on the cusp of adulthood, grew up without a father, but he is determined to find the man. His search leads him to various social services offices, to prison, and to a story of murder and betrayal with haunting ramifications.

Both Silva and Cunha are extraordinarily good. The fact that they've played these characters over many episodes of the City of Men TV show not only gives them a natural rapport, it also gives Morelli the chance to insert flashback sequences of the actors as boys and young teens.

Shot in a gritty, kinetic style that captures the colorful squalor of a neighborhood dubbed Dead-End Hill, City of Men is in many ways a more satisfying piece of storytelling than City of God. There are characters here to really care about, and while there is no absence of gunplay - as two rival bands set loose a bloody turf war - it's the interplay between friends, between fathers and sons, that really matters.

City of Men ***1/2 (out of four stars)

Directed by Paulo Morelli. With Douglas Silva, Darlan Cunha, Camila Monteiro, Jonathan Haagensen and Rodrigo dos Santos. Distributed by Miramax Films. In Portuguese with subtitles.

Running time: 1 hour, 50 mins.

Parent's guide: R (violence, drugs, profanity, sex, adult themes)

Playing at: Ritz FiveEndText

Contact movie critic Steven Rea at 215-854-5629 or srea@phillynews.com. Read his blog, "On Movies Online," at http://go.philly.com/onmovies.