BRUSSELS — David Cameron, the British prime minister, on Tuesday sharply criticized opponents of Turkey’s membership in the European Union, echoing concerns voiced in the United States that the bloc was doing too little to anchor Ankara within the West.

On his first visit to the Turkish capital since becoming prime minister in May, Mr. Cameron likened France’s opposition to Turkey’s bid for membership to the French veto of Britain’s bid to become part of the European Union’s forerunner in the 1960s.

Turkey began talks with the European Union in 2005, but progress has been painfully slow. Though the technical reason for this is connected to Turkey’s failure to recognize Cyprus, the political backdrop is one of division within the European Union as to whether a large, mainly Muslim nation should be admitted.

“When I think about what Turkey has done to defend Europe as a NATO ally,” Mr. Cameron said, “and what Turkey is doing today in Afghanistan alongside our European allies, it makes me angry that your progress toward E.U. membership can be frustrated in the way that it has been. My view is clear: I believe it is just wrong to say that Turkey can guard the camp but not be allowed to sit in the tent.”