The Spanish prime minister received a booby-trapped letter last week which was "similar" to one which exploded Wednesday at Ukraine's embassy in Madrid, lightly injuring an employee, officials said Thursday.
Security staff carried out a "controlled explosion" of the mailed item, whose "content was similar" to that found in other letters sent to the Ukrainian embassy, an air force base, the defence ministry and a military equipment firm.
The envelope, "containing pyrotechnic material" and addressed to Socialist Prime Minister Pedro Sanchez, arrived by regular mail on November 24, the interior ministry said in a statement.
On Wednesday the security officer at Ukraine's embassy in Madrid lightly injured his hand while opening a letter bomb addressed to the Ukrainian ambassador, prompting Kyiv to boost security at its embassies worldwide.
Spain's High Court has opened a probe for a possible case of terrorism.
Later in the evening, a second "suspicious postal shipment" was intercepted at the headquarters of military equipment firm Instalaza in the northeastern city of Zaragoza, the interior ministry said.
Experts carried out a controlled explosion of that mailed item as well.
Instalaza makes the grenade launchers that Spain donates to Ukraine.
Earlier Thursday, security forces also detected a "suspect envelope" at an air base in Torrejon de Ardoz outside of Madrid which is regularly used to send weapons donated by Spain to Ukraine.
Police were called to the base "to secure the area and investigators are analysing this envelope" which was addressed to the base's satellite centre, the interior ministry said.
"Both the characteristics of the envelopes and their content are similar in the four cases," it said in a statement, adding police had informed the National Court of the four incidents.
A fifth envelope with "explosive" arrived at the defence ministry in Madrid on Thursday morning, a defence ministry source told AFP.
Experts blew up the package at the ministry, the source added.