BRUSSELS/ANKARA (Reuters) - The British foreign minister and a senior EU official involved in negotiations to help keep Britain in the European Union both said on Thursday that a deal was taking shape that could be struck within weeks.

Prime Minister David Cameron has pressed for reforms to EU rules, to be agreed by fellow national leaders at a summit in five weeks time, that would let him campaign to stay in the bloc in a referendum which could then take place as early as June.

His foreign secretary, Philip Hammond, said on a visit to Turkey that London and Brussels were closing in on a deal. Britain seeks to curb welfare payments to immigrant workers from other EU states, unimpeded by EU treaties barring discrimination against EU workers on the basis of nationality.

“We are getting closer but (we’re) not there yet,” he said. Negotiators were working on proposals that could be circulated to leaders before they meet in Brussels for the next European Council summit on Feb. 18-19. “If it doesn’t happen in February we hope it will happen in the next Council,” Hammond added, referring to a summit on March 17-18.

The British-born EU civil servant who is coordinating the work of the executive European Commission on the issue told a European Parliament committee that political will on all sides had created a “very good prospect that agreement will be reached rather soon” with the goal being a deal in mid-February.

Jonathan Faull, who leads a Task Force set up by Commission President Jean-Claude Juncker to draft options, said negotiators had looked closely at how far Britain might limit EU immigrants’ entitlements without clashing with their fundamental rights.

FUNDAMENTAL RIGHTS “CONDITIONAL”

Both sides acknowledge particular difficulty with Cameron’s proposal to make EU workers spend four years in Britain before claiming benefits Britons receive immediately they start work.

But Faull said: “The fundamental freedoms are not unconditional.” He noted an array of legislation limiting them.

“So we have been involved in very serious consideration of the current legal framework,” he said. “And the question ... which will determine precisely the form of any changes ... will be whether the current framework contains sufficient flexibility to deal with the issues raised while obviously maintaining the fundamental principles ... which have to remain intact.”

One EU source familiar with some of the discussions told Reuters that EU lawyers were looking particularly closely into how narrowly they could define a “worker” -- non-workers enjoy far fewer rights under EU treaty rules on freedom of movement.

Saying that immigration is straining its public services, Britain wants to limit migrants’ access to social housing. Child benefit could also be reduced for them, the EU source said, by indexing it to levels in home countries where workers’ families remain -- often in poorer eastern Europe. EU officials have also floated the idea of an “emergency brake” -- a national right to freeze immigration if a welfare system faced a major crisis.

British negotiators have yet to show their hand on what they might accept, the EU source said.

But with campaigning starting for a referendum that must be held this year or next, Faull -- who told lawmakers he has lived abroad too long to have a vote himself -- said written proposals would have to be circulated by early February, before the summit, and would “become very much a matter of public debate”.

Polls show Britons undecided about whether to stay in the EU but Faull said the Commission was working hard to keep Britain, its second biggest economy, inside the 28-nation bloc.

“It has not been easy at all. It has not yet reached a final conclusion,” he said. “But what I have been encouraged by is a very strong desire to do so and to do so without sacrificing all that has been built up and is good in the European Union.”