People who do not "look Spanish" can be stopped by police as often as four times a day, according to report by Amnesty International.
The report, titled 'Stop Racism, Not People" claims discrimination in the country, often criticised for its history of racism, is condoned by the authorities.
According to Spanish law the police can check the identity of people in public places when there is a security concern.
However the report details incidents when deliberate identity checks on ethnic minorities have taken place with no grounds, while certain police stations in Madrid have weekly and monthly quotas for the number of illegal migrants they have to detain.
"This practice is unlawful under International human rights law," said Izza Leghtas, Amnesty International's researcher on Spain.
"It affects both foreigners and Spanish nationals from ethnic minorities. It is not only discriminatory and illegal - it also fuels prejudices - as those who witness such stops presume the victims to be engaged in illegal activities."
Although racial profiling itself does not always amount to discrimination, it is illegal if there is no reasonable justification.
"The Spanish authorities are using stop and search powers abusively as a way to control migration. Spain has the right to control migration, however that should not be at the expense of the rights of migrants and minorities to equality and protection from discrimination," Leghtas added.
"It is time the authorities acknowledge and condemn the practice of racial profiling as discriminatory and unlawful and take measures to eliminate it."
The charity is calling on the Spanish authorities to ensure that any quotas for detaining illegal migrants are stopped, while all stops are documented and recorded.
"Sometimes I am stopped three or four times in the same day. I show my documents, but sometimes they check the information to see if it is correct. When I'm on my way to work I'm in a hurry, they don't care, they check them anyway. Being stopped like this makes me feel very bad, like I am not free," said Jahid, an immigrant from Bangladesh.
The perception of racism in Spain is often highlighted in the sporting world. In 2008 Formula 1 driver Lewis Hamilton was subjected to racist taunting in during race testing at the Circuit de Catalunya in Barcelona.
In 2004, England footballers Shaun Wright-Philips and Ashley Cole were targeted with monkey chants by Spanish fans during an international friendly in Madrid.