Police said they confiscated four paintings by artist Konstantin Altunin and closed down the exhibition of his work in Russia's second city of Saint Petersburg, which is set to host world leaders for the G20 summit next month.
One of the paintings confiscated shows Putin playing with Medvedev's hair. He is wearing a strappy nightie, while Medvedev has cleavage bursting out of a bra and is wearing skimpy knickers.
"We received information from a citizen that the images in the museum broke the law. Police confiscated four paintings and currently experts are examining them," said police spokesman Vyacheslav Stepchenko.
The law, which critics says can be used to shut down any gay rights event, has prompted a chorus of international protest and British actor Stephen Fry this month called for Russia to be deprived of the right to host the Winter Olympics in Sochi next year.
The exhibition's organiser Alexander Donskoi told AFP that the police had accused the small privately-owned Museum of Power of extremism, a criminal offence that carries more serious charges.
One of the other paintings that was confiscated showed one of the anti-gay law's most outspoken backers, Saint Petersburg lawmaker Vitaly Milonov, in front of the rainbow symbol of the international Gay Pride movement.
Milonov accompanied the police who raided the exhibition, Donskoi said.
"After visiting the exhibition a few days ago, Milonov came yesterday evening with the police. He is behind the ban on the exhibition," he said.
