HAMBURG German Chancellor Angela Merkel said on Friday she is becoming more confident a deal to keep Britain in the European Union will be reached, but she warned more compromises may be needed on both sides.

Speaking at an event in Hamburg attended by British Prime Minister David Cameron, Merkel said issues such as changes to social security systems needed to be placed in a European context, not only a British concern.

"The way the talks have progressed so far are putting me in a confident mood," she said. However, she said she did not know how long negotiations would last.

Cameron has said he hopes to come to an agreement with EU leaders over his plans to renegotiate Britain's relationship with the bloc at an EU summit on February 18-19, paving the way for a British referendum on EU membership this summer.

British and EU negotiators agreed much of a reform package on Thursday, leaving Prime Minister Cameron to settle tricky final issues, notably on migration, at a summit next week.

"Europe needs Great Britain and Great Britain needs Europe," Merkel said in Hamburg, repeating her previous support for continued British membership. The EU's "ability to compromise" will be needed by all to resolve the package of changes Britain is seeking, she said.

"I wish that the United Kingdom will in the future too remain an active member of a successful European Union," she said. That would be in both British and German interests, she said.

Some concerns that Cameron had raised were "not only reasonable, but also supported by us (Germany)," Merkel said, including competitiveness, transparency and reduction of bureaucracy.

Every member state should also be in the position to "maintain the strength" of its social security system, she said.

Such issues were not only British, she said.

"Quite the opposite, when we can succeed in pouring these issues into a European mould, I think that Europe as a whole will gain."

(Reporting by Michael Hogan, editing by Larry King)

This story has not been edited by Firstpost staff and is generated by auto-feed.