The people of Catalonia should determine its future, the Scottish government has said.
The region's government has insisted a referendum on independence from Spain will go ahead on 1 October.
Madrid has vowed to block the vote, saying it is unconstitutional.
Commenting on the ongoing dispute, Scotland's External Affairs Secretary Fiona Hyslop said: "The decision over Catalonia's future direction is a matter for the people who live there."
In a statement published on the Scottish government's website, she added: "The Catalan and Spanish governments are perfectly entitled to take positions for and against independence.
"However, all peoples have the right to self-determination and to choose the form of government best suited to their needs, a principle which is enshrined in the UN Charter.
"The Edinburgh Agreement was an example of how two governments, with diametrically opposed views on whether or not Scotland should become independent, were able to come together to agree a process to allow the people to decide.
"It is essential that democracy and civil rights are respected in all countries."
Catalonia's regional government has insisted the ballot will take place as scheduled despite a growing clampdown by the Spanish state.
On Saturday, Catalan separatists and supporters of the region's right to hold a referendum on independence held a rally backing more than 700 mayors facing the threat of arrest.
The mayors have been called in for questioning by prosecutors for agreeing to facilitate the vote locally.
On Friday, the Spanish government gave the regional government 48 hours to abandon its "illegal" referendum plans or lose budgetary powers.
Attempts to block the official referendum website have continued.
Thousands of ballot boxes are said to have been hidden by referendum supporters.