The bomb went off in the middle of Zaragoza's Cathedral of Our Lady of the Pillar at around 1.50pm.
No one was injured in the blast, and no damage was caused to the Baroque church.
Police suspect left-wing activists of placing the home-made device, Spanish news agency Efe reported.
Investigators said the composition of the device was not yet known, but that it bore the hallmarks of similar devices favoured by left-wing groups.
This is not the first time a bomb has been placed in a Spanish church.
In February, a 1.2kg (2.65lb) device was planted in Madrid's La Almudena Cathedral by an anarchist group known as the Comando Insurreccionalista Mateo Morral.
"The objective of this bomb attack is clear — to strike at the Bourbon monarchy in its sacred places," said the group in a statement claiming responsibility for that attack.
"All of its majesty is the fruit of oppression and we, the oppressed, will finish them off through the violence of a revolutionary insurrection."