The bomb had been left outside a police building in the popular tourist resort of Santa Pola near Alicante. The little girl was the daughter of a policeman.
The blast happened as lots of people were coming back from a day on the beach.
The girl had been playing in her bedroom when the bomb went off. And the man who died had been waiting at a nearby bus stop.
About 40 others at the bus stop were also hurt, four of them seriously.
The Spanish government has blamed the terrorist group ETA for the bomb.
But the group have not said they carried out the attack yet.
ETA are a group called Basque separatists who want a part of Spain and France - known as the Basque region - to be made a separate country.