Spain has stepped up security measures at public and diplomatic buildings after a series of packages containing explosives, including one sent to Prime Minister Pedro Sanchez and another to the Ukrainian embassy in Madrid, where an employee was lightly wounded.

The Interior Ministry reported that the "envelope with pyrotechnic materials" addressed to Sanchez was received on November 24 and disarmed by his security service.

The device was "similar" to parcels subsequently received by the Ukrainian embassy and a Spanish arms firm on Wednesday, the report said, as well as a device intercepted at the Spanish Air Force base of Torrejón de Ardos early Thursday morning.

A fifth device was received by the Spanish Defense Ministry Thursday morning and was defused by special police officers, a defense ministry spokesman told Reuters.

A source close to the investigation said the devices, sent to the prime minister's office, the Ukrainian embassy, an airbase and a weapons manufacturer, were in identical brown envelopes and addressed to the heads of each institution.

According to the source, they contained loose powder with an electrical ignition mechanism that caused the powder to burn rather than explode.

The source added that the Spanish postal service Correos was invited to participate in the preliminary examination of all such envelopes.

Spain's high court, which specializes in terrorism, has launched an investigation.

The device sent to the Ukrainian embassy was received Wednesday at lunchtime and exploded when it was opened by a security officer.