BRUSSELS  Prime Minister Vladimir V. Putin of Russia warned European officials on Thursday that uprisings in North Africa and the Middle East could produce governments hostile to the West, and he criticized the European Union’s energy policy.

Speaking in Brussels, Mr. Putin cautioned that previous Western policy had produced unintended consequences for the West, saying that the leader of the Iranian revolution, Ayatollah Ruhollah Khomeini, once enjoyed widespread Western support, and that a Western insistence on elections had led to a Hamas victory in Gaza.

Mr. Putin’s comments came during a combative news conference with the European Commission president, José Manuel Barroso, after a dozen Russian ministers visited the commission, the European Union’s executive body.

The two men also clashed over the impact of European energy policy on Russia’s energy giant, Gazprom.