Image copyright EPA Image caption Jean-Claude Juncker was among the leading EU officials and MEPs to meet Ms Sturgeon on her visit to Brussels

The French president and Spanish prime minister have both said they are opposed to the EU negotiating potential membership for Scotland.

Spanish premier Mariano Rajoy said he "believes everyone is extremely against it" and that "if the UK leaves, Scotland leaves".

President Francois Hollande of France insisted the EU would make no advance deal with Scotland.

Nicola Sturgeon said Mr Rajoy's comments were not surprising.

The Scottish first minister has been in Brussels for a series of talks with senior EU officials, after pledging to protect Scotland's interests in Europe following last week's Brexit vote.

She said she had received a "sympathetic response" but stressed she did not underestimate the challenges.

Ms Sturgeon has raised the possibility of a second independence referendum but said all of the potential options for keeping Scotland in the single market would be explored.

Any separate deal for continued Scottish membership before the UK completes its two-year withdrawal process would depend on unanimous support from EU member states.

But acting Spanish prime minister Mr Rajoy said after a summit of EU leaders in Brussels that he wanted to be "very clear Scotland does not have the competence to negotiate with the European Union".

Image caption Mr Rajoy and Mr Hollande were in Brussels for a summit of European leaders to discuss the Brexit fallout

He added: "Spain opposes any negotiation by anyone other than the government of United Kingdom.

"I am extremely against it, the treaties are extremely against it and I believe everyone is extremely against it. If the United Kingdom leaves... Scotland leaves."

Spain was a vocal opponent of Scottish independence ahead of the 2014 referendum, largely because of the situation in Catalonia where there is a strong independence movement.

Meanwhile, Mr Hollande said: "The negotiations will be conducted with the United Kingdom, not with a part of the United Kingdom".

In other developments:

UK Prime Minister David Cameron told MPs that the best way to secure Scotland's place in the European single market was for the UK to negotiate the "closest possible relationship" with the EU.

Mr Cameron added: "Our membership of the European Union is a UK membership, and that is where we should take our negotiating stance".

The prime minister also said he raised Scotland with the European Council and he was glad Ms Sturgeon was having meetings in Brussels

US bank JP Morgan has said it now expects Scotland to vote for independence and introduce its own currency before Britain leaves the European Union in 2019.

JP Morgan economist Malcolm Barr said in a note to clients: "Our base case is that Scotland will vote for independence and institute a new currency at that point (2019)"

Ms Sturgeon met European Commission president Jean-Claude Juncker in Brussels, but was told by European Council president Donald Tusk that a meeting with him would not be appropriate at this time.

She also met EU Parliament president Martin Schulz, as well as Gianni Pitella, the leader of the Progressive Alliance of Socialists and Democrats in the European Parliament, and former Belgian prime minister Guy Verhofstadt, who is now an MEP.

Image caption A pro-EU rally was held outside the Scottish Parliament on Wednesday evening

Mr Schulz said he had "listened carefully and learned a lot", while Mr Pitella said he was "sympathetic" to Scotland's situation but that it was an issue to be solved within the UK.

Ahead of his meeting with Ms Sturgeon, Mr Juncker said: "Scotland won the right to be heard in Brussels so I will listen carefully to what the first minister will tell me.

"But we don't have the intention, neither Donald Tusk nor myself, to interfere in an inner British process that is not our duty and this is not our job."

Ms Sturgeon said she had received a "sympathetic response" to the position Scotland found itself in, having voted to remain in the EU while the UK voted as a whole to leave.

Image copyright PA Image caption Nicola Sturgeon and Martin Schulz met shortly after the first minister's arrival in Brussels

She said: "I have not been here today to reach any conclusions or to press anybody for any decisions or any commitments. I have been here to make sure that Scotland's voice is being heard and that Scotland's position is understood. I am confident that is the case - I found doors to be open here today.

"If there is a way for Scotland to stay (in the EU) then I am determined to try and find that way.

"My concern at this stage is to ensure that once the UK's negotiation with the EU starts, then all of the options are on the table.

"I don't underestimate the challenges of that, but I have been heartened today that I have found a willingness to listen."

Scotland voted by 62% to 38% in favour of remaining in the EU in last week's referendum but faces being taken out of the EU after the UK as a whole voted to leave - a situation Ms Sturgeon has described as a "democratic disgrace".

Labour MEP David Martin, who was appointed to an expert panel on the EU set up by the first minister on Tuesday, said Ms Sturgeon had "acted extremely competently in this process".

He said: "I think coming to Brussels early to test the water - she's not going to get any decisions today - on where we are in terms of relationship with the European Union and how we might take that forward, I think is very positive."