The officers also removed a picture of the head of the Russian Orthodox church, his torso covered in tattoos, and two others poking fun at MPs who have backed legislation banning so-called gay propaganda, gallery staff said.
The police service said it had taken paintings from the Museum of Power gallery – based in two rooms of a flat – late on Monday after receiving reports that they were illegal. It gave no further detail but Russia does have a law against insulting authorities, an offence that carries a maximum one-year prison term.
One painting showed Putin wearing a tight-fitting slip and brushing the hair of the prime minister Medvedev, who is wearing knickers and a bra.
The St Petersburg deputy Vitaly Milonov, whose face was combined with the gay rights movement's rainbow flag in one of the paintings, said the images were inappropriate and "of a distinctly pornographic character".
St Petersburg, which hosts world leaders at a G20 summit next week, was one of the first Russian cities to introduce a law banning the spread of "gay propaganda". The Russian parliament has also adopted similar legislation, prompting protests from abroad and calls for a boycott of the Winter Olympics which Russia will host in the Black Sea resort of Sochi in February.
The gallery's owner, Alexander Donskoy, said the officers had also shut down his establishment and gave him no explanation for the removal of paintings from the exhibition.
"This is an [illegal] seizure," he said. "We have been given no formal documents banning us from operating and no receipt confirming our petty cash was seized."
• This article was amended on 28 August 2013 to correct the name of Vitaly Milonov, which was wrongly given as Mironov.