Discussions on transitional arrangements for an independent Scotland to remain in the European Union (EU) after the UK leaves have been taking place in Brussels, a former senior adviser to the European Commission (EC) has disclosed.

Dr Kirsty Hughes told MSPs discussions have been taking place about putting Scotland in a "transitional holding pen" after Brexit to avoid "an absurd out and then in process".

She urged MSPs to hold a second independence referendum by summer 2017 at the latest, if it is judged to be in the best interests of Scotland, to allow the EU to start work on these transitional arrangements.

However, she warned the EU "does not want a mini-UK" and said Scotland is unlikely to keep the UK's "awkward squad" opt-outs of the euro, justice and home affairs and the UK budget rebate.

Holyrood's European and External Relations Committee heard from a range of experts on Scotland's position following the UK vote to leave the EU on June 23.

Experts agreed it is extremely difficult to envisage a situation where Scotland remains both in the EU and the UK, suggesting independence is the most likely route for Scotland to remain in the EU.

Dr Hughes, now an associate fellow of the Friends of Europe think tank, told MSPs: "I talk to people in Brussels, off the record, who were talking about Scotland being in some sort of transitional holding pen.

"It wouldn't have a seat in the Council of Ministers until ratification of the treaties, but it wouldn't have to go through an absurd out and then in process.

"I go through all that for now because I think there is a timing issue.

"If Scotland waits until nearly the end of the two years to say, 'This isn't okay and now we're having an independence referendum', you might not have had that and had time to have the negotiations with the rest of the UK on dissolving the union before the whole of the UK has left.

"So, it's obviously a very big political judgement about whether and when to call an independence referendum.

"If it was only a question of logic, you would call it as soon as possible in my view.

"You would call it, anyway, let's say, by next summer because then you would have actually had the dissolution talks - if it was successful - with the UK before the UK left.

"That would make it much easier for the EU to get into some of these transitional holding pen arrangements than otherwise."

However, she added: "The EU does not want a mini-UK back in the EU if the rest of the UK is leaving.

"In other words, it does not want the awkward squad member in a smaller form.

"So if the idea of a successor state is that you want the opt-outs from the euro, the budget rebate, the opt-in deal on justice and home affairs, I don't think that will be forthcoming."

Writing on Twitter, Dr Hughes later clarified that the discussions on Scotland's EU transition had taken place in 2014 but are likely to come up again following Brexit.

She said: "To clarify, I meant in 2014, but with more positive Brussels attitude to Scotland now (it is) likely to come up again."

Other experts told MSPs that it is hard to envisage Scotland remaining in the EU while it is still part of the UK.

Drew Scott, professor of European Union studies at Edinburgh University, said: "The difficulties of any arrangements of the UK in its present structure with Scotland having an exceptional position are very difficult to conjure up.

"How would Scotland be represented? I think the Greenland option is probably the one that is somewhere."

Some commentators have talked about Scotland "doing a reverse Greenland", pointing out Greenland left the EU but remained part of the Kingdom of Denmark.

However, Prof Scott, who has also advised the European Commission, said this could cause difficulty with cross-border trade between Scotland and England.

"You would have to set up a whole bunch of arrangements to ensure that English goods ... didn't enter the EU via a free trade corridor that Scotland enjoyed with the EU," he said.

Professor Sir David Edward, a former judge at the European Court of Justice, said those imagining "a free-floating Scotland" in the EU and the UK "cannot ignore geography".

"It's fine talking about Greenland but Scotland isn't even remotely Greenland," he said.

"It's connected by its navel to England, and you have to start from that rather simple fact."

He added: "It doesn't seem to me possible to envisage a position of Scotland remaining part of the UK but having a separate relationship in relation to the single market. Customs and all sorts of complications arise."

Earlier External Affairs Secretary Fiona Hyslop had told the committee that the UK Government "should think carefully about when and how they lodge article 50" and trigger the departure process.

But she added: "They haven't told me what there plans are because I don't think they have their plans yet."

Ms Hyslop said: "I have absolutely, hand on heart, no idea where the UK Government is coming from and what they are trying to achieve and we might not even know that till September.

"My worry is if they move quickly for article 50 lodging, either now or indeed at the point of a new leader coming in, if we're not in before that making sure our voice is heard and that we get a chance to express our views, it will be very difficult afterwards."

A senior political spokesman for First Minister Nicola Sturgeon described Dr Hughes' revelation that Brussels figures are discussing transitional arrangements for Scotland as "an interesting contribution".

However, he would not be drawn on suggestions that MSPs should hold another independence referendum by summer 2017.

He said: "Once Article 50 is invoked there is roughly a two-year period, and the First Minister made clear that her view would be that if we decide to go down the path of a referendum it would probably have to be within that two-year period.

"Beyond that I am not narrowing. We're simply not at that stage yet."