Peru's government on Monday ordered telecommunications companies to grant police warrantless access to cellphone users' locations and other call data in real time and store that data for three years, a decree that civil libertarians called an unconstitutional invasion of privacy.

The government published the legislative decree on a national holiday and a day before Peru's independence day celebrations, when schools, government offices and most businesses are closed. Its contents were not debated in Congress and it was enacted under special powers that lawmakers recently granted to President Ollanta Humala's government.

Activist Katitza Rodriguez of the Electronic Frontier Foundation said she had not seen "any legal provision anywhere that stripped geolocation data of constitutional communications privacy protections as explicitly" as the Peruvian decree.

It follows a global pattern of governments seeking to fast-track surveillance legislation without public debate, said Rodriguez, the foundation's international rights director.

The government said the measure is needed to fight organized crime in a country plagued by cocaine trafficking, extortion, murder-for-hire, illegal logging and land trafficking. The decree does not allow eavesdropping on actual conversations without a court order.

As a safeguard against abuse, the decree stipulates that police must retroactively obtain a judge's approval in order to use the data in court.

Digital rights attorney Erick Iriarte said that does not offer much protection because while a judge "could revoke the use of the data, (if I am the police) I already have the data."

The so-called metadata covered by the decree includes "where you are making a call, the time and who you are talking to," and that is an invasion of privacy, Iriarte said.

He said he was very concerned over which branches of Peru's police will have custody over and access to the information.

The decree specifies a "special unit," but Peru's national police force is plagued by corruption, with sensitive information regularly leaked for political reasons and sometimes shared with criminals.