The Queen has spoken of the need for unity in Europe and how the continent must strive to "maintain the benefits of the post-war world" in an speech to Germany and Britain's leaders.
Her comments were made at a state banquet in Berlin in the presence of German chancellor Angela Merkel and Prime Minister David Cameron, who wants reform of Britain's membership of the European Union.
The Queen, who is on a four-day state visit to Germany with the Duke of Edinburgh, went on to say that "division in Europe is dangerous".
As head of state she remains politically neutral but the Queen's comments may be interpreted by some as the sovereign expressing a view on the EU debate.
The Prime Minister's proposals for reform will be considered by European leaders at a summit tomorrow and he has indicated he believes changes to the EU's fundamental treaties will be necessary to meet his demands.
Germany's president Joachim Gauck went further in his banquet speech and said the EU needed Britain and that it would support a "constructive dialogue" on the reforms Mr Cameron wants.
The Queen told her host, as guests sat down to dinner at the 18th century Bellevue Palace, Mr Gauck's official Berlin residence: "In our lives, Mr president, we have seen the worst but also the best of our continent. We have witnessed how quickly things can change for the better.
"But we know that we must work hard to maintain the benefits of the post-war world.
"We know that division in Europe is dangerous and that we must guard against it in the West as well as in the East of our continent. That remains a common endeavour."
The Prime Minister wants to renegotiate Britain's membership ahead of a referendum by the end of 2017 and although the issue is not on the formal agenda for the Brussels summit he will have an opportunity over dinner tomorrow to explain to the EU's 28 national leaders the reforms he is seeking.
The Prime Minister's moment at the gathering could yet be overshadowed by the crisis over Greece, which is engaged in desperate last-minute talks with eurozone members to extend its bailout funding.
The German president told the Queen in his speech: "Your Majesty,y ou have also witnessed the advance of European integration. A quarter of a century after the division of our continent ended, the European Union is facing major challenges.
"We know that we need an effective European Union based on a stable foundation of shared values.
"A constructive dialogue on the reforms Britain wants to see is therefore essential. As a good partner, Germany will support this dialogue. For Britain is part of Europe. The European Union needs Britain.
"A united Europe, a strong European Union, represent stability, peace and freedom - for us all.
"There is a saying in the nautical world, 'There is but a plank between a sailor and eternity'. Yes, some planks in the European ship could be improved. But to be frank, we in Germany would rather strengthen the planks than tear them out."
The Queen paid tribute to the way in which Germany has rebuilt its relationships with surrounding countries since Adolf Hitler's Nazi regime was defeated in 1945.
She said: "Germany has reconciled with all her neighbours. I pay tribute to the work of the German statesmen since the Second World War who reinvented Germany and helped to rebuild Europe."
Mr Gauck highlighted the positive impression the UK's forces who helped liberate Europe had on his fellow citizens: "Seventy years ago, British soldiers came to Germany, not to exact vengeance but to liberate our country. Their own commitment to human dignity served as their moral compass.
"We Germans are so impressed to this very day by the conduct of these troops that the Instructions For British Servicemen In Germany became a best-seller last year."
The president went on to say that Britain helped to establish democracy and the rule of law in western Germany after the war, and supported the German people during reunification.
He also paid a personal tribute to the Queen: "None of this would have been possible without British-German reconciliation. That foes have become friends is partly thanks to Your Majesty.
"You experienced the terrors of the war - the bombing of London and Buckingham Palace by the Germans. Nevertheless, you and your fellow Britons made a gesture of reconciliation, aptly in Dresden, the city where the war begun by Germany left especially deep wounds.
"Through the Dresden Trust, many British donors - under royal patronage - helped to ensure that the Frauenkirche could be rebuilt."
Before the Queen arrived yesterday, the monarchy's annual accounts were published and there was a suggestion from royal sources that Scotland could cut its contribution to the British monarchy by more than £1 million if plans for further devolution get the go-ahead.
But Scotland First Minister Nicola Sturgeon told the BBC today that there had not been "and never will be" plans by her administration to cut its contribution to the upkeep of the Royal Family when further powers are devolved to Holyrood.
Sir Alan Reid, Keeper of the Privy Purse, issued a statement this evening, saying of yesterday's press briefing he hosted on the royal accounts: "The comments and observations were about a principle and never intended to be a criticism of Scotland or of the First Minister or to suggest that the First Minister had cast doubt on the continued funding of the monarchy."