Tanasak Sopatai, 27, who travelled to the UK on a student visa, allowed the Castle Terrace flat to be used by Thai women who used it as a brothel, the court heard.
He had pleaded guilty at the city’s Sheriff Court earlier this month that being the tenant, lessee or occupier he knowingly permitted the premises or any part of it to be used as a brothel or for the purposes of habitual prostitution.
His defence agent Graeme Runcie told Edinburgh Sheriff Court: “He willingly allowed the premises to be used as a brothel.
“There were girls working there, they were Thai, their English was limited. Mt Sopatai met them in London, his English was better but by no means perfect.”
“His purpose was to meet up with a landlord and to sign a lease. There was no financial input for Mr Sopatai. The money for the rent was paid by the girls. They were using his mastery of the English language.”
Mr Runcie said his client had already served the equivalent of eight months in prison.
He said his client had overstayed his Visa, and wished to return to Thailand as soon as possible.
Sheriff Paul Arthurson said: “You have pled guilty to a serious charge. I am satisfied that I can impose a backdated custodial sentence for a duration of nine months.”
The sentence will be backdated to 27 June.