HAVANA – The Roman Catholic Church said Wednesday that Cuba has agreed to free 52 political prisoners and allow them to leave the country in what would be the island’s largest mass liberation of dissidents since Pope John Paul II visited in 1998.

Five would be released in a matter of hours and planned to head into exile in Spain, while the remaining 47 would be liberated in “a process that will take three or four months starting now,” according to the statement by the office of Havana’s Roman Catholic Archbishop, Cardinal Jaime Ortega.

The deal was announced following a meeting between President Raul Castro and Ortega. Also participating was visiting Spanish Foreign Minister Miguel Angel Moratinos and his Cuban counterpart, Bruno Rodriguez.

“We feel enormous satisfaction,” Moratinos said in a statement released by the Spanish Embassy. “This opens a new era in Cuba with hope of putting aside differences once and for all on matters of prisoners.”

The scope of the agreement “is a surprise,” said Elizardo Sanchez, head of the independent Cuban Commission on Human Rights and National Reconciliation. “We were hoping for a significant release of prisoners, but not this.”

Ortega’s office said that those to be released were all members of a group of 75 leading political opposition activists, community organizers and journalists who report on Cuba in defiance of state controls on media. They were rounded up in a crackdown on dissent in March 2003.