British Prime Minister David Cameron expressed confidence that a deal could be reached allowing Britain to remain in the European Union and avoid a so-called "Brexit".
"When it comes to the question of Britain's place in Europe, I have always been confident that together we can secure the reforms that address Britain's concerns and also work for Europe as a whole," Mr Cameron told a banquet in the German city of Hamburg, where he was guest of honour alongside Chancellor Angela Merkel.
Britain has "always been a country that reaches out," Cameron told guests of Hamburg's historic "Matthiae-Mahl" banquet in the ornate town hall.
"And I never want us to pull up the drawbridge and retreat from the world.
"So when it comes to the question of Britain's future in Europe, my aim is clear: I want to keep Britain inside a reformed European Union," Mr Cameron said.
"If by working together we can achieve these changes, then I will unequivocally recommend that Britain stays in a reformed European Union on these new terms."
Mr Cameron is engaged in an intensive round of high-stakes diplomacy aimed at renegotiating the terms of Britain's EU membership before holding an in-out referendum.
He must convince his 27 fellow EU leaders to back the controversial reform proposals at a leaders' summit in Brussels on February 18-19.
He said that if no deal was reached, "then I rule nothing out. But I believe we can -- and if we do, I believe we can win that referendum and that will be good for Britain, good for Germany and good for the whole of Europe.
Ms Merkel insisted that "my wish is that the United Kingdom is and remains an active member of a successful European Union."
That was not only in Germany's interest, "but also in Britain's and in the interests of the entire EU," Ms Merkel said to thunderous applause.
The banquet's host, Hamburg mayor Olaf Scholz, said Britain was "irreplaceable" in European foreign and defence policy.
"And from an economic point of view, too... we can't and won't do without London," he added.
Britain needed to show "pragmatism and courage... and their ability to compromise," said Scholz, who is a member of the Social Democrat SPD party which shares power with Merkel's conservative CDU party.
Drawing an analogy to football, Scholz said that "the British alone will decide what the result will be, whether the ball is in or out. And this time, we're all hoping the decision will be: In."