The proposal was debated late on Tuesday; 183 lawmakers opposed the ban, 162 lawmakers voted for it and two abstained.
The nonbinding proposal had been put forward by the leading opposition Popular Party, which portrayed it as a measure in support of women's rights.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
The ruling Socialist Party opposed the ban.
Other European countries have also debated banning body covering clothing such as burqas or niqabs.
Within Spain, the city government of northeastern Barcelona and some neighbouring town councils have banned the wearing of such garb in public buildings such as town halls and hospitals.

