The Scottish parliament has sent a letter of apology to a trans woman who was searched by a male guard on a visit.

The unnamed woman was attending an LGBT Scotland event at Holyrood in November but female security guards refused to search her because they thought she was a man.

All visitors to the building are given a pat-down search by a security guard of the same gender if they set off metal detectors.

A Holyrood source told the Scotsman: “It was an unfortunate incident, but nobody in the security team believes they did anything wrong.

“The visitor was a man as far as the security staff could tell. In those circumstances, it was felt it was fine for a male security guard to search him before he came in.”

The woman complained to LGBT Youth Scotland about the incident. The charity then submitted a formal complaint of her behalf.

Head of policy Mhairi Logan said: “The parliament have been very understanding and we are pleased with how they are treating the matter. We have received an initial letter of apology and we expect the issue to be resolved soon.”

LGBT Youth Scotland has asked for staff to be given training on how to deal with trans visitors.