Under the decree being finalised, people would be allowed out only for emergencies, to buy food, or for work.
With 191 deaths and 6,046 infections, Spain is the worst-hit country in Europe after Italy, which declared a nationwide lockdown on Monday.
The US is extending its European travel ban to the UK and the Republic of Ireland from Monday.
President Donald Trump confirmed the news in answer to a reporter's question at the White House.
On Friday, the World Health Organization (WHO) said Europe was now the "epicentre" of the pandemic.
Italy has seen 1,266 deaths and 17,660 infections.
Director General Dr Tedros Adhanom Ghebreyesus urged countries to use aggressive measures, community mobilisation and social distancing to save lives.
Several European countries have reported steep rises in infections and deaths in recent days.