Members of 380 regional and 70 state-run feminist organisations in the capital protested with representatives from Spain's main political parties, trade unions and non-governmental organisations linked to gender equality.
Organisers said 21,000 people traveled to take part, including some from Spain's Balearic and Canary islands.
The protest was Madrid's first state-wide march calling for an end to violence and discrimination against women, what protesters called "sexist terrorism".
The march got underway after Angela Gonzalez, whose daughter was murdered by her abusive ex-husband, spoke in memory of those who died as a result of gender-based attacks.
"I think it's important that people like me demonstrate today, because I'm an example of a woman who's been able to get out of domestic violence, and that means that all abused women can also get out violence and that they deserve a better life. You really can get out," said Olga Aranza, a 45-year-old domestic violence survivor.
Gonzalez said since 1995 more than 1,390 women have been murdered in Spain by male attackers and that so far this year 84 cases of murders of women by men have been recorded.

Thousands of mainly women join a protest march against male violence in downtown Madrid, Spain Source: AAP
"All these deaths can be prevented with more resources. We should build a principle-based education system and undertake prevention policies, because it's much better to prevent than to regret," said protester, Teresa Alba.
A survivor of domestic violence described the impact her abusive relationship has had on her family and her life in the Spanish capital, Madrid.
Miryam Moraleda was stabbed in front of two military policemen in 2007 by her former boyfriend of 12 years.
He was sentenced to eight years in prison and was released last July.
"He was sentenced to 8 years in prison. He got out this year on July 10," Miryam Moraleda said. "He's been released for good. He's now free; I am not."
Moraleda said she has to carry a global positioning system (GPS) wherever she goes so that police is aware of her location, as her ex-boyfriend threatened to kill her after he was released from prison.
"The last phrase I heard from his mouth was 'I have to kill you. I will get out of prison, but you won't get out of the cemetery'. I still remember and fear that phrase. I go out to the street in fear. I carry a GPS (global positioning system), I need to be very cautious, in fact, I cannot go to tomorrow's demonstration because he lives in Madrid."
She added that her family is forced to move homes often so that her former partner cannot track them down.
About 120,000 women report incidents of domestic abuse to the Spanish authorities every year, according to official figures.
Last year, more than 19,000 people were put on trial for violence against women and 14-thousand of them were convicted.
The Director of Women Foundation, Marisa Soleto, said Saturday's rally is aimed at putting pressure on Spanish authorities to do more to protect women and ensure gender equality in the southern European country.