The nurse is said to be the first person in the current outbreak known to have contracted Ebola outside Africa.
Health Minister Ana Mato said the woman was part of the team that treated Spanish priest Manuel Garcia Viejo, who died of the virus on September 25.
Some 3,400 people have died in the outbreak – mostly in West Africa.
The nurse is in a stable condition, Reuters quoted health officials as saying. She started to feel ill last week when she was on holiday.
She was admitted to hospital in Alcorcon, near Madrid, on Monday morning with a high fever, Ana Mato said.
Doctors isolated the emergency treatment room.
The infection was confirmed by two tests, the minister said.
Manuel Garcia Viejo died in the hospital Carlos III de Madrid after catching Ebola in Sierra Leone.
Another Spanish priest, Miguel Pajares, died in August after contracting the virus in Liberia.
Ebola spreads through contact with the bodily fluids of someone who has the virus and the only way to stop an outbreak is to isolate those who are infected.
There have been nearly 7,500 confirmed infections worldwide, with officials saying the figure is likely to be much higher in reality.
Guinea, Sierra Leone and Liberia have been hardest hit.
Celebrations in West Africa for the Muslim festival of Eid al-Adha are being badly affected by the Ebola outbreak, with many public places deserted this weekend.
Earlier, US health officials said passengers arriving in the US from Ebola-affected countries in West Africa could be subject to extra screening at airports.
But the White House said on Monday it was not considering a ban on passengers from such countries, according to Reuters news agency.
It comes as the US tries to limit the spread from its first confirmed case, a Liberian national, Thomas Eric Duncan, in Dallas.
8lnqsA4VHmoThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…