In a significant boost to the prime minister’s bid to reform the European Union, the chancellor did not rule out treaty change.
Germany has “clear cut hope” that Britain will remain a member of the EU but negotiations are set to be “protracted”, she said following the talks in Berlin.
Ms Merkel said: “Of course we have the desire to work very closely together. We would like to be a part of the process that is going on in Great Britain at the moment and we would like to be a constructive partner in this process.”
Mr Cameron said: “Of course there is no magic quick solution, but as the chancellor has said on this previously, and again today, where there’s a will, there is a way.
“The European Union has shown before that when one of its member states has a problem that needs sorting out, it can be flexible enough to do so, and I have every confidence that it will do so again.”
Mr Cameron believes treaty change is required in order to deliver real reform in key areas such as welfare but France and Germany have previously been cool about such a move.
In an earlier meeting with his Polish counterpart, Mr Cameron failed to secure support for benefit restrictions for migrant workers.
No 10 said Mr Cameron and Ewa Kopacz found “much they could agree on” during talks in Warsaw but plans for benefit reforms “should be discussed further”.
Poland has repeatedly condemned proposals to curb welfare for migrant workers as “discriminatory” and pledged to block them.
Poland’s minister for European affairs, Rafal Trzaskowski, told Sky News: “Our message was clear. We think it is of utmost importance for all of us to keep the United Kingdom within the European Union, and we are ready to sit down with the British and discuss the issues.
“But obviously, our red line is non-discrimination. We have to take such decisions that are not going to discriminate against anyone within the union. These are going to be tough discussions, but we are open to talks with our British counterparts.”