THOUSANDS of people have rallied in Madrid and Barcelona calling on Spanish and Catalan leaders to begin talks amid Catalonia's imminent threat to secede from Spain.

The demonstrators in the Spanish capital and the Catalan city wore white T-shirts and respected the organisers' call to not bring Spanish or Catalan flags.

Catalonia's regional president, Carles Puigdemont, has vowed that he will push for separation after last Sunday's disputed referendum on secession was won by independence campaigners. He is believed to be preparing to make an announcement on Tuesday.

Spanish prime minister Mariano Rajoy has promised that Catalonia will not secede.

Protesters packed Barcelona's Sant Jaume Square where the Catalan Government has its Presidential palace, shouting, “We want to talk!” and holding signs saying “More Negotiation, Less Testosterone!” and “Talk or Resign!”

The gathering around Madrid's Cibeles fountain boasted a huge banner demanding that the leaders start talking. Some people chanted “Less hate, and more understanding!” and “Carles, Mariano, let's see if you can call each other.”

There was a separate rally in Colon Square where thousands holding Spanish flags clamoured for the unity of Spain and against any attempt by the north-eastern region of Catalonia to break away.

Tensions almost boiled over when a small group of people waving Spanish flags, apparently from the pro-union rally, began shouting at people at the pro-dialogue rally. Police quickly moved in to separate the two groups.

The calls for dialogue and unity come after a traumatic week in Spain, which reached its peak last Sunday during Catalonia's referendum. Riot police stormed several polling stations in an unsuccessful attempt to impede the vote. Instead, they left an estimated 900 voters injured.

More than two million Catalans voted despite the crackdown, with 90 per cent voting for independence.