The couple fled after they were alerted to their mistake by another naked man who ran in after them.

Lothian Green MSP Andy Wightman recounted the incident as an example of the problems residents faced when a growing number of flats in their stair are used for short-term lets.

Mr Wightman, who has led the campaign for regulation of Airbnb and similar online accommodation platforms, said there were “unintended consequences” from the growth of tourism in the Capital.

Sign up to our daily newsletter The i newsletter cut through the noise Sign up Thanks for signing up! Sorry, there seem to be some issues. Please try again later. Submitting...

The couple entered the wrong flat, thinking it was their own short term let. Pic: Shutterstock

And he said the Greens were soon to launch a pilot scheme asking residents to help record the number and location of short-term commercial lets across the city.

He told a seminar at Edinburgh University Business School that it was hearing the stories of residents which had made him realise how serious the problem was.

He said: “In one tenement in the high street where there are 12 flats, there’s only three residents left, there are three or four student flats and the rest are commercial short-term lets. In one of the residential flats is an elderly lady in her 80s - she moved to the tenement when she was three and has lived there ever since.

“As was the custom in common stairs, she kept her door onto the stair unlocked - obviously the stair door to the street was locked.

“One evening her door burst open and a naked woman ran into her flat pursued by a naked man and they proceeded to have sex in front of her in the living room and then another naked man ran in shouting ‘You’re in the wrong flat’ and they fled. That caused her a bit of consternation.”

He said in another case, a student’s future had been damaged thanks to a short-term let. “She was sitting her Highers exams, there was a party going on upstairs, some rugby fans had hired the flat, she didn’t get a very good sleep, she failed her Higher exam - it was a critical one she need to get to university, so she didn’t get her university place.

“These are two examples of the kind of disruptive force of what might otherwise be seen as a fairly benign economy can have on the daily lives of ordinary people.”

Mr Wightman told the seminar, the latest of a series of Edinburgh Dialogues looking at the future for the Capital, that the number of whole properties in the Capital for let on Airbnb had increased from 5366 to over 7400 in a year - a rise of 35 per cent.

But he said there was a lack of information about the extent of commercial short-term lets in the city.

“Data is key to understanding what’s going on - and we don’t properly understand that so we will be launching soon a pilot, crowd-sourcing initiative online which will be inviting people to report the number and location of commercial short-term lets right across the city.

“Through social media we think we can reach large numbers of people. We will run the pilot for six weeks or so and then launch it properly.