"We saw a big explosion, a column of smoke in front of the civil guard barracks and a four-by-four vehicle fly through the air," a man named Paco, who witnessed the attack, told public radio RNE.
Police said they had defused a second bomb found underneath a civil guard vehicle not far from the barracks where the two men were killed.
"A second bomb placed under an official vehicle was found at another barracks than the one affected by the first attack. It was then defused," a civil guard spokesman said.
Jonah Hull, Al Jazeera's correspondent in San Sebastian in the Basque region, said: "No-one is in any doubt, here in Spain, that this was the work of Eta.
"This has become in recent years something of a common practice for Eta to launch a campaign of bombing during the summer, at the height of the tourist season, and certainly not confined to the Basque region.
"The fear nationwide now is that this is the beginning of something that might be far more sustained."
The bomb exploded near Palma de Mallorca, the capital of the Balearic Islands, which is a popular tourist destination.
Police closed the island's main airport for two hours before reopening it in an attempt to track down those behind the attack.
The island's seaport and marinas remained closed as part of a security lockdown called "Operation Cage".
Local media have said the blast carried the hallmarks of Eta, which traditionally targets the civil guard.
On Wednesday, a car bomb outside a police barracks in the city of Burgos, in Spain's north, injured about 46 people, blowing off the face of the building.
Eta will mark the 50th anniversary of its founding on Friday. It is blamed for the deaths of more than 820 people over the past 40 years.