* Trial begins in terror plot against newspaper
* Four defendants plead not guilty to terror charge
* One pleads guilty to illegal possession of weapons
* Prosecutors say will show links to Pakistan (Adds details, background, quotes)
By Mette Fraende and John Acher
GLOSTRUP, Denmark, April 13 (Reuters) - Four men went on trial in Denmark on Friday accused of planning a "Mumbai-style" terror attack on the offices of a Danish newspaper whose publication of cartoons of the Prophet Mohammad in 2005 outraged many Muslims.
The men, three Swedish citizens and one Tunisian, pleaded not guilty to involvement in the worst terrorist plot in Denmark to date, denying allegations they had planned to kill a large number of people at the offices of the paper, Jyllands-Posten.
"It is our perception that an unknown number of people were to be killed by shooting," Chief Prosecutor Gyrithe Ulrich told TV2 News outside the courthouse in Glostrup, near Copenhagen.
Jyllands-Posten was the first to print a dozen cartoons lampooning Islam in 2005, triggering protests against Danish interests abroad and riots in countries from the Middle East and Africa to Asia the following year in which at least 50 people died.
Denmark's state security police (PET) has said the planned attack was modelled on a 2008 shooting spree in Mumbai, when 10 Pakistani gunmen killed 166 people in a three-day assault at city landmarks, including two hotels and a Jewish centre.
The men belonged to a militant Islamist group and had links to international terrorist networks, the PET has said.
On trial are Mounir Ben Mohamed Dhahri, a Tunisian, and three Swedish citizens - Lebanese-born Munir Awad, Swedish-born Omar Abdalla Aboelazm, and Sahbi Ben Mohamed Zalouti, of Tunisian origin.
The four were arrested in a joint Danish-Swedish police operation in the suburbs of Copenhagen and Stockholm on Dec. 29, 2010. Police, who had been tracking the men for some time, have said that the attack was imminent "within days".
All four pleaded not guilty to the main charge of terrorism, but Dhari pleaded guilty to the charge of illegally possessing weapons, which the others denied.
Awad and Zalouti entered the courtroom wearing handcuffs, while Aboelazm and Dhahri had their hands free. When the judge entered, Zalouti rose to his feet after being urged to do so by his lawyer. The three others stood without prompting.
The prosecution described the events leading up to the men's arrest, presenting an automatic pistol found in a car rented by the defendants as evidence, as well as plastic strips which police said could have been used to handcuff victims.
Prosecutors played recordings from a police interrogation of Zalouti, who was arrested in Stockholm.
He was heard saying that the three others planned to carry out the attack, but that he wanted no part of it.
"It was planned," Zalouti said on the tape. "An attack in Denmark with the three guys you are holding down there."
He confirmed the attack was a response to the caricatures of the Prophet, which he said had continued to provoke Muslims.
Wearing casual sporty clothes, Zalouti listened calmly to the recording, telling the court he had considered going to the Swedish security police Sapo with the information, but that it was too hard for him to turn in his best friend, Dhahri.
"I tried to get out," he said.
David Headley, a Pakistani-American who said he scouted targets in Mumbai for the Pakistan-based Lashkar-e-Taiba militant group, had previously told investigators he had helped al Qaeda plan an attack in Copenhagen. He was arrested in 2009.
Senior prosecutor Henrik Plaehn said the prosecution could link the defendants to Pakistan and displayed a map of the country, pointing out the Waziristan region near the Afghan border.
The prosecution presented as evidence a copy of a 2010 money transfer to Pakistan found in Zalouti's flat.
Zalouti said the money was sent to Dhahri, who he said was studying in Pakistan.
The trial continues on Monday. Seventeen sessions are scheduled, and a verdict is expected soon after the trial ends around June 15. (Editing by Tim Pearce and Andrew Osborn)