Police will be told they need a judge's permission to access journalists' phone records, the Home Office has said.

A temporary measure means officers must follow the Police and Criminal Evidence Act 1984 and get legal permission to obtain any communications data.

The move comes after strong criticism of the way police were using the Regulation of Investigatory Powers Act (Ripa) to access journalists' sources.

The Home Office said it was an "interim solution" ahead of the next parliament.

The prime minister agreed to the change two weeks ago after a review by the Interception of Communications Commissioner, but the government is now publishing the details of it.

Former Lord Chancellor Lord Falconer said a permanent change in the law was "a matter of urgency".

The Home Office said it was determined to make the changes as "soon as is legally possible".

"We are legislating as far as possible now until a bill can be introduced in the next parliament which delivers the recommendations in full," a spokesman said.

'Better than nothing'

Calls within government for the change had been led by Deputy Prime Minister Nick Clegg.

Lord Falconer, who helped promote Ripa when it was introduced in Parliament, told BBC Radio 4's Today programme that while the temporary measure was "better than nothing... something much more dramatic needs to be done".

He added that it was had never been envisaged that Ripa "would be used by the police in the way that it's been used".

"There may be exceptional circumstances where a journalist is not acting as a journalist, but acting as a sort of criminal.

"But assume the journalist is acting as a journalist, then in my view, before any disclosure of communications data... is made, it should go before a judge so that he or she can make a judgement as to whether or not the interest in a free press is in fact overridden by the need to investigate crime."

'Permanent safeguards'

An inquiry into Ripa was launched last autumn after it was revealed that police in London and Kent accessed journalists' phone records as they investigated two cases.

One was the Plebgate affair, which took place in 2012 when police officers would not let former minister Andrew Mitchell cycle through Downing Street's main gate.

The other was the case of former cabinet minister Chris Huhne, who was jailed for perverting the course of justice in 2013.

Mr Clegg said: "We're glad the Tories have finally found some sense and have at least agreed to ensure temporary measures are put in place to protect journalist sources.

"Whilst temporary measures are better than none, we will not stop pushing to ensure permanent safeguards are put in place."