WASHINGTON -  The ratings agency S&P maintained Spain's investment-grade sovereign credit rating late Friday, but warned tensions between Madrid and Catalonia could weaken growth prospects if left unchecked.

Catalonia is due to hold an independence referendum on Sunday that is opposed by the central government, in one of the greatest political crises to hit the country since the restoration of democracy in 1975.

S&P Global Ratings said Friday it was affirming its BBB+/A-2 long-term sovereign debt rating and said the country had a positive outlook, with its economy expected to grow by about three percent this year -- above the eurozone average.

"The positive outlook signifies that we could raise our ratings on Spain within the next 18 months if the country's strong economic performance continued," the company said in an analysis of its ratings decision.

However, it added continued turmoil could see the skies turn a little darker.

"We could also revise the outlook to stable if the current tensions between the central government and the regional government of Catalonia escalated and started weighing on business confidence and investment, leading to less predictable future policy responses."

S&P said Spain's minority government had limited ability to carry out policies, like budgetary and structural reforms, because of the country's fragmented parliament.

Catalonia was likely to remain part of Spain, the analysis said, but tensions were also likely to persist.