British Airways was forced to apologise today after the credit card details of hundreds of thousands of its customers were stolen over a two-week period in the worst ever attack on its website and app. 

The airline discovered on Wednesday that bookings made between August 21 and September 5 had been infiltrated in a "very sophisticated, malicious criminal" attack, BA Chairman and chief executive Alex Cruz said. 

The airline immediately contacted customers when the extent of the breach became clear. 

Around 380,000 card payments were compromised, BA said, with hackers obtaining names, street and email addresses, credit card numbers, expiry dates and security codes - sufficient information to steal from accounts. 

The attack came 15 months after the carrier suffered a massive computer system failure at London's Heathrow airport, which stranded 75,000 customers over a holiday weekend. 

Shares in BA's parent, International Airlines Group, fell 3% in early deals today. IAG also owns Aer Lingus. 

Cruz said the carrier was "deeply sorry" for the disruption caused by the sophisticated crime, which was unprecedented in the more than 20 years that BA had operated online. 

He said the attackers had not broken the airline's encryption but did not explain exactly how they had obtained the customer information. 

"There were other methods, very sophisticated efforts, by criminals in obtaining the data," he said. "It was having access to our systems in an illicit way, it was very sophisticated."

British Airways informed customers affected by the attack on Thursday, Cruz said. It advised them to contact their bank or credit card provider and follow their recommended advice. 

It also took out ads in UK newspapers today. 

Cruz said anyone who lost out financially would be compensated by the airline. 

"The moment we found out that actual customer data had been compromised that's when we began an all-out immediate communication to our customers, that was the priority," he said. 

IAG said the data breach had been resolved and the website was working normally, and that no travel or passport details were stolen. 

The airline had launched an investigation and notified police and other relevant authorities. 

After the computer system failure in May 2017, BA said it would take steps to ensure such an incident never happened again.

But in July it was forced to cancel and delay flights out of the same airport due to problems with a supplier's IT systems.