A second independence referendum will "almost certainly" be demanded by Scots if the UK votes to leave the EU but Scotland does not, the first minister has said.
Nicola Sturgeon told the BBC's Andrew Marr many people in Scotland would object to being taken out of the EU "against their will".
Ms Sturgeon insisted she would be arguing the case for the UK to stay in.
Campaigning ahead of the EU referendum is already under way in Scotland with both sides trying to sway voters ahead of the summer ballot.
The SNP, Labour, Conservatives, Liberal Democrats and Greens have all said they are supporting remaining part of the EU.
UKIP has said it will campaign in Scotland for the UK to leave, with the party's Scottish leader, David Coburn, saying the country would be better off out of Europe.
Asked on the BBC's Andrew Marr programme if a second independence referendum would definitely be triggered if the UK voted to leave the EU but Scotland did not, Ms Sturgeon said: "Almost certainly, I think that would be the demand of people in Scotland.
"I hope this scenario doesn't arise. I hope the UK as a whole votes to stay in the EU for a whole variety of different reasons.
"But if you cast your mind back to the Scottish referendum, the No campaign then said if Scotland voted Yes then our membership of the EU would be at risk. That was rubbish then, but that was a key argument."
She went on: "If, a couple of years later, we find ourselves, having voted to stay in the EU, being taken out against our will, I think there will be many people - including people who voted No in 2014 - who would say the only way to guarantee our EU membership is to be independent.
"That, I think, is inescapable."
Ms Sturgeon said she thought the EU reform deal negotiated by Mr Cameron "didn't live up to expectations" and she said her reasons for wanting to remain in the EU were "rather different" to the prime minister's.
Former SNP deputy leader and veteran independence campaigner Jim Sillars is among those campaigning for Scotland to leave the EU.
On the BBC's Sunday Politics Scotland programme, he said: "During the 2014 independence referendum the European Union told us to get stuffed. They weren't prepared to accept Scotland becoming a new member state.
"So I see no reason why I should got to bat for an organisation that told us to get stuffed in 2014, and if the UK remains in membership, will tell us to get stuffed in the second independence referendum. We don't owe them anything.
Opposition parties in Scotland said the first minister should concentrate on the EU referendum campaign rather than Scottish independence.
The Conservatives said "as always with the SNP, everything comes back to their campaign for independence", while the Liberal Democrats said the EU campaign "must not be used as a proxy campaign for independence".