The Tunisian and Pakistani had opened a Twitter account on which they posted threatening messages written by hand and held up in front of historic Italian monuments, from the Colosseum in Rome to the Duomo in Milan.
"We are in your streets, we are everywhere. We identify our targets while we wait for zero hour", said one message, written in Italian, French and Arabic.
Milan prosecutor Maurizio Romanelli said, however, that the sites in question "were never in danger" because the pair, based in Brescia in northern Italy, had not set their plans in motion.
"The two men were referring to several targets, particularly the Ghedi military base" near Brescia, "but also other possible targets including law enforcement forces," he said at a press conference.
The two men had also downloaded from the Internet a manual on bomb-making and how to disguise their identities online, he said.
"This morning's arrests show our system to prevent terrorist attacks works. It confirms that Internet controls allow us to take preventative action with great efficiency," Interior Minister Angelino Alfano said.
Their arrest was part of an investigation carried out by Italy’s anti-terror squad, Digos, which began in April.
Italy raised its terror alert level following the deadly attacks in France, Tunisia and Kuwait in late June.
Last week, an Albanian man suspected of recruiting on behalf of Isis was deported. The expulsion came a week after another man was arrested in Pisa, accused of spreading jihadist propaganda and inciting terrorism.
Meanwhile, seven others were arrested in early July as part of Italy’s anti-terror sweep.