ROME — The Italian police on Wednesday arrested two men accused of plotting attacks on national landmarks in Italy and of posting threatening messages online in support of the Islamic State.

One photograph identified by the police as evidence showed Milan’s central train station with a caption that said: “Islamic State in Rome. We are on your streets.”

The two men, a 35-year-old Tunisian and a 26-year-old Pakistani, lived near Brescia, in the Lombardy region. Prosecutors said the men had also set their sights on a military base near Brescia as a potential target and had expressed a desire to travel to the territory controlled by the Islamic State, also known as ISIS or ISIL, to receive military training.

“They spoke of many potential targets,” but the two were arrested before moving “into an active phase,” a Milan prosecutor, Maurizio Romanelli, said at a news conference on Wednesday.