With “The Dictator,” Sacha Baron Cohen and his partner in comic crime, director Larry Charles, leave the improvisation of “Borat” and “Bruno” behind and return to the more structured world of scripted comedy. And the strain shows.

The unruliness, the chaos of their improvised “gotcha” mockumentaries, is missing. Cohen, forced to remember lines, stick to a script and sustain a character who only exists when the director says “Action,” struggles with the voice, the persona.

The result is a fitfully hilarious farce made up of patched-together comic “bits” — the bit where the dictator stages his own Olympics (and shoots other sprinters to win his race), the bit where the dictator, having anointed himself his nation’s chief surgeon, attempts to deliver a baby (with the camera taking an in-utero point of view), the bit where the dictator and a flunky have an amused, animated pseudo-Arabic chat about exploding fireworks, American landmarks and Osama bin Laden in front of tourists on a New York helicopter tour.

Most of the bits are funny, but the film that connects them is flat, the performances — especially Cohen’s — incomplete, under-developed and poorly cut together.

Cohen plays General-Admiral Aladeen (think “Aladdin,” with an accent), dictator-for-life of the North African nation of Wadiya. Any resemblance to Libya is purely intentional.

Aladeen wants nuclear weapons, but his idea of what they should look like comes from Bugs Bunny/Daffy Duck cartoons, something his chief scientist (Jason Mantzoukas) wants to explain away.

“For one second, pretend that I am an idiot,” Aladeen asks.

“I’m there.”

Aladeen polishes off each paid-celebrity sexual conquest (Megan Fox has a cameo) with a “You now have HERPES!”

His people, especially his long-suffering second in command (Ben Kingsley), have to address him as “Benevolent oppressor.”

No wonder they plot his overthrow. No wonder he has to have doubles (shades of “The Devil’s Double”) just to survive the assassination attempts.

When Aladeen ventures to New York, he may think it’s just to address the U.N. and mock the United States. “America — built by the blacks, and owned by the Chinese!”

But that’s where the dissidents make their move. A torture session goes wrong and he isn’t killed.

But he does lose his beard, and now nobody believes that his even dumber double (Cohen, in a slightly funnier guise) isn’t the real Aladeen.

The dictator is forced to lie low at a food co-op run by a plucky, short-haired unshaven-armpits cliche, Zoe (Anna Faris).

If Aladeen is to return to power, he’ll need her unwitting help. He’ll need to stop calling her hairy names. He’ll need to stop joking that she looks like a boy. “Wolverina! Hairy Potter! Justin Bieber’s chubby double!”

The movie’s broad swipes about race, Middle Eastern politics and an America set up to benefit its own dictators — the “1 percent” — are funny enough. But some play like lectures.

The British-Jewish Cohen speaks a sort of Pan-Arabic jibberish, and takes pains to avoid any hint of offending Islam. You wonder if Borat would muzzle himself like that, even at the risk of a fatwa.

And working with scripted material exposes Charles as a clumsy moviemaker who lets us see the action before “action” and lets takes run on too long.

For every outrageous “No, no, no, NO they didn’t!” moment — the in-utero camera birthing scene, for instance — there are three masturbation bits that aren’t funny, that peter out long before “Cut!”

This team still has no trouble finding laughs in the outrageous, the shocking. But the subject matter seems years too late to be edgy and hip.

And without the spontaneity of Cohen interacting with rubes who don’t know they’re in a movie (“Borat”), “The Dictator” feels winded — like a sprinter who can only win by shooting everybody else in the kneecap.