Four men charged with plotting a terror attack in Denmark were likely targeting an event that the crown prince was attending to retaliate for newspapers publishing cartoons of the Prophet Muhammad, prosecutors said.

At the start of a trial Friday in Copenhagen, prosecutors said evidence suggests the four men — three Swedish citizens and one Swedish resident — were planning a shooting spree at a newspaper building in Denmark during an annual sports award ceremony in December 2010.

Prosecutor Henrik Plaehn told the court there was no indication that Crown Prince Frederik was singled out, "but there are things that point to the event itself being a specific target."

Munir Awad, Omar Abdalla Aboelazm and Mounir Ben Mohamed Dhahri had driven from Sweden and were arrested on their way to Copenhagen just hours before the ceremony. The fourth defendant, Sabhi Ben Mohamed Zalouti, left the car while it was en route and returned to Stockholm. He was arrested by Swedish police the same day.

The men, who are of North African and Middle Eastern origin, face charges of terrorism and illegal weapons possession. They have all denied the terrorism charges, but Dhahri intends to plead guilty to the weapons accusation, his lawyer Henrik Stagetorn, told The Associated Press.

If found guilty of terrorism, they could face about 16 years in prison.

"There is no doubt this planned attack was the consequences of the cartoon drawings," Plaehn said, referring to the 2005 publication of 12 caricatures depicting the Prophet Muhammad that triggered rioting in Muslim countries and calls for revenge among militant Islamists.

Further, the prosecutor said he intended to prove that members of the group had ties with Pakistan — possibly including terrorist training in tribal areas in the north of the country.

The trial was Denmark's second criminal proceeding in 14 months related to the drawings. In February last year, a Danish court declared a Somali man guilty of terrorism for breaking into the home of one of the cartoonists. Wielding an ax, the man entered Kurt Westergaard's home in the northwestern town of Aarhus, though the cartoonist avoided injury by locking himself inside a panic room.

The Somali man was eventually sentenced to nine years in prison.