Campaigners are calling for a change in regulations after a Glasgow man was unable to become a commercial airline pilot because he is HIV positive.
The man, who wants to remain anonymous, had been offered a place on an airline's training programme.
But the Civil Aviation Authority (CAA) refused him the medical certificate needed to gain a commercial licence.
The CAA said European regulations prevented it granting the certificate to someone who was HIV positive.
The European Aviation Safety Agency (EASA) said it was considering a rule change.
Anthony (not his real name) said it was "utterly devastating" to discover that he could not take up the position on the EasyJet pilot training scheme.
He described the policy as "outdated" and "inherently discriminatory".
HIV Scotland has called for a change in the rules.
Why are HIV positive people unable to become pilots?
According to the CAA, which is responsible for aviation safety regulations in the UK, certain medical conditions prevent would-be pilots obtaining the necessary certificate. These include being HIV positive, organ transplantation or having type 1 diabetes.
Pilots who already hold a commercial licence but later develop one of the conditions would still be able to operate.
However, their licence would change and only allow them to fly with a co-pilot. This is known as an operational multi-crew limitation (OML) licence.
Some flights are only possible with a pilot and a co-pilot, especially long haul and commercial flights.
Under the current rules, student pilots have to perform solo flights during their training and are therefore not allowed to have a condition that qualifies them to only fly with a co-pilot.
These rules are regulated by EASA and apply to Europe. The same restrictions do not apply in some countries, such as Canada.
The CAA said the EASA had confirmed that people making an initial application for a commercial pilot licence must have an unrestricted medical certificate.
A CAA spokesperson added: "We support a rule change in this area, where it is safe to do so, and will continue to work with EASA and HIV experts to reassess this regulation, with a view to enabling applicants to obtain an initial Class 1 medical certificate."
The EASA said it was considering a change to the rules.
In a statement, it said: "A rule change takes time, it needs to be considered by experts, and we need to plan it and prioritized by performing impact assessment.
"However, EASA and the NAA (National Aviation Authority) medical experts agreed that a rule change should be considered due to the availability of new HIV medications.
"These medications could provide for a more flexible regulatory approach and allow the need for an OML restriction to be determined on a case-by-case basis, largely dependent on the stage of the HIV.
"In future, this would allow some prospective pilots having HIV to obtain a license without an OML restriction."
EasyJet said it was a matter for EASA and the CAA, but added: "We welcome the CAA's support for a rule change where it is safe to do so."
Anthony's case was first brought to light by Buzzfeed News.
Anthony gained his private pilots licence aged 17, before he was able to drive. He has wanted to be a pilot since he was a child, and began flying when he was 15.
He was diagnosed with HIV three years ago, and wrote to the CAA under a pseudonym to ask about the effect his diagnosis would have on his dream.
Anthony said the CAA told him that he would be granted the medical certificate and could train, but that he would have to fly alongside a co-pilot.
Earlier this year he passed all the assessments at EasyJet, and gained a place on their training programme.
When Anthony was told his HIV would stop him becoming a pilot he was "very confused".
He said the disappointment was worse because he believed there was "no barrier if you're HIV positive to doing anything now that you wanted to do before".
"I had started to accept the diagnosis because of that."
He said: "In 2017, someone who is HIV positive and on successful treatment is medically no different to someone who isn't HIV positive."