Media playback is unsupported on your device Media caption Chris Grayling MP: "I'd like to apologise on behalf of my department"

An investigation into the recording of telephone calls between prisoners and their constituency MPs has been ordered by the justice secretary.

Chris Grayling said confidential conversations may have been taped and listened to by prison staff.

He said the monitoring may have taken place between 2006 and 2012, before the government "tightened up" the system.

Mr Grayling apologised to the Commons and said at least 32 current MPs could have been affected.

"This issue stretches back to 2006 and primarily relates to the period prior to autumn 2012 when this government made changes to tighten up the system," said Mr Grayling.

"This is a serious matter and I would like to start by apologising to the House on behalf of my department for any interception of communications between a prisoner and their constituency MP."

He also said a small number of calls between prisoners and their lawyers could also have been "accidentally" recorded.

Prison rules

The justice secretary told MPs an independent investigation would be carried out by the Chief Inspector of Prisons Nick Hardwick.

The investigation will report back by the end of the month to ensure the necessary safeguards are in place, and a full report will be published by early 2015.

Mr Hardwick said: "I will begin work today to urgently review the steps the National Offender Management Service have taken to prevent this from happening in future.

I don't believe this was part of a concerted attempt to monitor Chris Grayling, Justice Secretary

"I will also independently investigate what has happened in the past and will report fully on the facts of what has occurred and my recommendations to the secretary of state."

Mr Grayling said prison rules clearly state that phone calls between MPs and prisoners who are their constituents must be treated as confidential.

Shadow justice secretary Sadiq Khan asked if there was any evidence the information had been passed on to senior officials.

Mr Grayling said: "I have as yet seen no evidence that information was passed on to anyone else. I don't believe this was part of a concerted attempt to monitor, it was simply part of the routine checking of this process to make sure nothing untoward was going on."

He said early investigations appeared to show that calls to 32 MPs had been recorded.

"For 18 of these MPs it appears the prison did not list the number as confidential and therefore the action was not taken to prevent recording," he said.

"In a further 15 cases, members appear to have been identified correctly on the system as MPs, but due to a potential failure in the administrative process the required action was not taken by prison staff so the calls were recorded and appear to have been listened to. One member falls under both categories."

Since improvements to the system in 2012, only one MP clearly identified on prison lists has had their calls with prisoners recorded and listened to, he added.

Mr Grayling also said he believed all recordings had been destroyed, as they were only kept for a limited period.