Mr Barroso responded to Mr Putin by saying criticism was allowed in Europe
Russia and the EU have traded accusations over human rights abuses, at their first high-level talks since a gas row soured relations last month.
European Commission President Jose Manuel Barroso said the killings of a human rights lawyer and a journalist in Moscow recently caused the EU concern.
Russian Prime Minister Vladimir Putin then angrily accused the EU of human rights abuses within its own territory.
He said "the full range of problems" concerning rights had to be discussed.
The murder of prominent Russian human rights lawyer Stanislav Markelov and newspaper reporter Anastasiya Baburova in broad daylight in Moscow last month drew international condemnation.
Russia's plan to build military bases in two breakaway regions of Georgia also raised tensions during the discussions, correspondents say.
On Thursday, the Czech Republic, holder of the EU presidency, said it was "seriously concerned" by the moves in South Ossetia and Abkhazia, over which Russia and Georgia went to war last August.
"The EU would consider the implementation of such plans to be a serious violation of the principle of Georgia's sovereignty and territorial integrity," it said.
Speaking just before the visit by Mr Barroso, an EC spokesman told the BBC that the talks would be a test of whether the political relationship could now improve despite the continuing fall-out from last month's gas crisis and the war between Russia and Georgia.
He stressed that in a mature relationship it should be possible to discuss areas of all of disagreement, including the rule of law and human rights.
And that is exactly what Mr Barroso did during his talks with Russian President Dmitry Medvedev, the BBC's Richard Galpin in Moscow says.
Last month's murders fuelled fears about freedom of speech in Russia
But when Mr Barroso went on to disclose this at a news conference following his next meeting with Prime Minister Vladimir Putin, he got an earful, our correspondent adds.
Mr Barroso had said the European Union was concerned about the murder of journalists and human rights activists in Russia.
Visibly angry, Mr Putin accused him of hypocrisy, saying immigrants' and prisoners' rights in Europe were being trampled on, as were the rights of Russian minority populations in the Baltic states.
"We need to discuss the full range of problems - both in Russia and in Europe - in order to be able to solve them," he added.
Mr Barroso shot back by saying that in Europe, criticism was accepted.
And he stressed that the Baltic states - which are EU members - are democracies that respect the rule of law.
Our correspondent says it was a bitter exchange, and the visit seems to have highlighted tensions rather than built bridges.
Before his meeting with Russian President Dmitry Medvedev earlier on Friday, Mr Barroso had said negotiations on a new EU-Russia framework agreement were under way.
He said the nine commissioners accompanying him on the visit represented "the many issues we need to discuss so that we can deepen our relationship".
The EU does not have a lasting guarantee of Russian gas supplies
Mr Barroso said the gas dispute between Russia and Ukraine, which caused severe gas shortages in several EU states after Russia halted supplies, was one of the issues and reiterated his disappointment at the incident.
"It is important now to create conditions for this kind of crisis not to happen again. We believe energy security is a very important sphere of interest for Russia and the European Union," he said.
"And this positive interdependence is more important now than ever because we are facing a very serious global financial crisis," he said.
Mr Medvedev said there needed to be a "fully-fledged international legal system" to prevent a recurrence.
Russia cut gas supplies to Ukraine on New Year's Day, saying it would pump only enough for customers further down the pipeline. But it then accused Kiev of siphoning off gas intended for third countries.
Ukraine denied the claim, but the flow of Russian gas ceased completely on 7 January.
Hundreds of thousands of people went without heating in Eastern and South-Eastern. Bulgaria, one of the hardest hit countries and a historical ally of Russia, had to close schools and public buildings.
Gas flows were resumed on 20 January after Russia and Ukraine finally agreed prices at which Ukraine would buy gas, and ship it to Europe. The EU sent monitors to their borders to check the flow of gas.