Of the 350 parliamentary seats at stake, 101 represent sparsely populated provinces.
The main parties in the April 28th vote, aware of rural voters' anger, were all represented at the march dubbed the “Revolt of an Emptied Spain”.
Ministers from the ruling Socialist party included economy chief Nadia Calvino, Environment Minister Teresa Ribera and Agriculture Minister Luis Planas.
The Socialist party has pledged to support professional training and internet access in rural areas.
The centre-right Ciudadanos party has proposed sharp tax cuts for the residents of towns with fewer than 5,000 residents. Its leader Albert Rivera also took part in Sunday's march.
Police counted around 50,000 along the main march route, while organisers estimated turnout at nearly twice that.
- Spain struggles to repopulate its deserted rural interior
- How Spaniards are helping to save the country's 4,200 villages at risk of extinction
- Adopt an olive tree: Breathe new life into rural Spain
“This Spain, the emptied Spain, wants its voice heard,” the organisers' manifesto said.
The Economic and Social Council of Spain, a body that advises the government on economic and labour issues, said in a report in early 2018 that the country counts around 3,900 villages with fewer than 500 residents.
Of those, nearly one-third have fewer than 100 inhabitants and face “maximum risk of extinction”, it said.
Two of the provinces most hit by urban drift are Teruel in the east and Soria, north of Madrid.
In Teruel, “bank branches have disappeared,” said Josefina Soriano of the advocacy group “Teruel Exists”.
“There are elderly people who have to ask a neighbour to go to the (nearest town) to withdraw money for them,” Soriano said.
Angel Fernandez, a Soria farmer, said: “The province is dying. Despite its great potential, they're leaving us without trains, without highways.”