The airline, Iberia, defended the test in the name of safety. Government and union officials decried the practice as sexist.
Iberia said this week that it would drop the practice after being fined for discrimination.
The airline required potential employees to pass a series of tests before being hired, including a medical examination, which for women meant a pregnancy test. Iberia described it as a routine step used to ensure the safety of employees.
The practice was widely criticized in Spain, which has laws prohibiting gender discrimination. The company was fined 25, 000 euros, or $28, 000, by officials in the Balearic Islands, which include Mallorca and Ibiza. Iberia said in a statement that it would not appeal the fine and would stop administering the tests.
Spain’s minister for health, social services and equality, Dolors Montserrat, did not directly address the Iberia fine, but in an emailed statement, she said the authorities would “continue to be extremely vigilant against any form of work discrimination based on sex or for any other reason.”
The carrier, which is part of the International Airlines Group — one of the world’s largest air travel businesses and the parent company of British Airways and Aer Lingus — said the test was among multiple examinations that were administered after candidates had been selected to be hired but before a formal job offer was tendered.
“Given the controversy, arising from the current protocol in place to protect pregnant women, we will no longer include a pregnancy test in the medical examination for new hires, ” said Maria Teresa Garcia Menéndez, the company’s health and safety officer.
Other airlines have been criticized over their hiring practices, particularly when it comes to dealing with female job candidates and employees.
Two female flight attendants at Aeroflot, the Russian flag carrier, sued the airline for age and sex discrimination after it began enforcing weight guidelines for cabin crews last year. The women said they were barred from international flights because their clothing sizes were larger than the rules allowed. Aeroflot has denied the claims.
And in May, two flight attendants working for Frontier Airlines, a no-frills carrier based in Denver, sued the company, asserting that they were discriminated against when they were not allowed to pump breast milk while on duty.
Iberia said it had not rejected any qualified candidates for being pregnant, insisting that it had strict rules for protecting pregnant employees. Female cabin workers are moved away from flying duties as soon as they notify the company of their pregnancies; this month, more than 32 female cabin attendants have been assigned to different jobs because they were pregnant, according to the airline.
In the last year, it said in its statement, six pregnant women applied for jobs in its handling division, and five were hired. The sixth was rejected after failing an airport driving test. It did not provide details for other departments.