* Ex-Putin aide loses out in power struggle
* Putin criticised government at meeting on Tuesday
* Speculation mounts of Medvedev-Putin rift (Adds quotes from source close to Kremlin)
By Timothy Heritage
MOSCOW, May 8 (Reuters) - Deputy Prime Minister Vladislav Surkov, once one of Russia's most influential men and the creator of Vladimir Putin's tightly controlled political system, was ousted on Wednesday in a power struggle between Kremlin and government.
The Kremlin said President Putin had accepted the resignation of the man who for a decade wielded immense power as the grey cardinal behind the scenes under the former KGB spy but later moved over to Prime Minister Dmitry Medvedev's camp.
The departure of one of his most experienced lieutenants is a shot across the bows for Medvedev, who is under growing pressure a year after swapping jobs with Putin for failing to halt Russia's slide towards recession.
"It's of his own volition," presidential spokesman Dmitry Peskov said, dismissing suggestions Surkov, 48, had been pushed. "It's to do with the fact that decrees were not carried out."
But such decisions are almost always choreographed by Putin who, sitting at the head of a table with cabinet ministers on either side, glared straight at Surkov as he scolded them at a meeting on Tuesday for not carrying out his orders and decrees.
Russian media and political analysts have long said a rift has opened up between Putin and Medvedev, his long-time ally and a former president, although both deny it.
"Of course it's a strike against Medvedev," said Dmitry Oreshkin, an opposition-minded political analyst.
"It is a direct intervention by the president into the nomenklatura of the government. It turns out he was simply devoured. It will take some time and the prime minister will also be devoured."
Surkov is best known inside Russia for shaping the Kremlin's mindset under Putin: confident, ruthlessly commercial, anti-Western and authoritarian despite his pet phrase, "sovereign democracy," under which Putin and his United Russia party dominate the political scene.
As Putin's top political adviser, Surkov became known as the Kremlin's puppet master, or Russia's answer to France's Cardinal Richelieu or a modern-day Machiavelli, and was loathed by opponents, whom he often targeted with his acerbic wit.
One author wrote that he was "absolutely unnoticeable as a living person" in the role of grey cardinal or puppet master. But he came to be seen as Russia's third-most-powerful political figure, after Putin and Medvedev, and kept a portrait of Argentine-born revolutionary Che Guevara in his Kremlin office.
He quit the Kremlin in December 2011 after street protests threatened Putin's grip on power and attacked the very system he helped create, undermining what had appeared his peerless mastery of the political scene. He had also made a mistake by calling the protesters "the best part of society" in Russia.
In government, Surkov had been responsible for overseeing implementation of presidential decrees and innovation projects.
He may yet be back because Putin often rotates the people he trusts, moving them from one role to another. Surkov spoke out in London at the weekend in favour of creating alternative parties to United Russia, fuelling speculation he might return eventually in a role overseeing a new pro-Kremlin party.
His comments in London may have been part of his downfall because he criticised federal investigators looking into suspected embezzlement at Skolkovo, a state-owned innovation hub created by Medvedev.
A spokesman for the federal Investigative Committee, which has been instrumental in pursuing criminal cases against Kremlin critics and is headed by Putin ally Alexander Bastrykin, hit back in a newspaper article criticising Surkov.
Half-Chechen, Surkov also has a bohemian side. He has written songs for a Russian rock group, Agata Kristi, and is widely believed to be author of a novel called "Almost Zero" which was published under a pseudonym.
He had become increasingly distant from Putin since the start of the protests over Putin's decision to return to the presidency after four years as prime minister, a post he held while Medvedev kept the president's seat warm for him.
"The differences between them began long ago," a political source close to the Kremlin said of Putin's relationship with Surkov. Making clear who was behind Surkov's departure, he said: "Only one person could have decided this - Putin."
Surkov's exit left Medvedev's government looking like "a table with only three legs" that could be toppled at any time, political analyst Alexei Mukhin told Ekho Moskvy radio, though there are no outward signs Putin is about to dismiss Medvedev.
Surkov shares a degree of cynicism with many of his generation of Russians who were educated as the children of a superpower only to see the Soviet empire collapse around them.
He served in the army before entering business as the Soviet Union crumbled. Among his patrons were Alfa Group, owned by rich businessman Mikhail Fridman, and oil tycoon Mikhail Khodorkovsky, who was jailed after falling foul of the Kremlin.
Surkov first joined the Kremlin under then-president Boris Yeltsin and also worked there under Medvedev. (Additional reporting by Darya Korsunskaya, Maria Tsvetkova, Polina Devitt and Steve Gutterman, writing by Timothy Heritage, editing by Elizabeth Piper and Jon Boyle)