The health ministry said the woman had recently returned from Colombia, where it is believed she was infected.
Zika, which is spreading through the Americas, has been linked to babies being born with underdeveloped brains.
The World Health Organization (WHO) has declared the microcephaly condition, linked to the mosquito-borne virus, a global public health emergency.
The Spanish health ministry said the pregnant woman was diagnosed as having Zika in the north-eastern Catalonia region.
It did not release the woman's name, saying she was one of seven confirmed cases in Spain.
The ministry stressed that "the diagnosed cases of Zika virus in Spain... don't risk spreading the virus in our country as they are imported cases".
More on the Zika crisis:
Microcephaly: Why it is not the end of the world
What you need to know Key questions answered about the virus and its spread
Travel advice Countries affected and what you should do
The mosquito behind spread of virus What we know about the insect
Abortion dilemma Laws and practices in Catholic Latin America