The breach took place in 2018 and affected both personal and credit card data.
The fine is considerably smaller than the £183m that the ICO originally said it intended to issue back in 2019.
It said "the economic impact of Covid-19" had been taken into account.
However, it is still the largest penalty issued by the ICO to date.
The incident took place when BA's systems were compromised by its attackers, and then modified to harvest customers' details as they were input.
It was two months before BA was made aware of it by a security researcher, and then notified the ICO.
The data stolen included log in, payment card and travel booking details as well name and address information.
A subsequent investigation concluded that sufficient security measures, such as multi-factor authentication, were not in place at the time.
The ICO noted that some of these measures were available on the Microsoft operating system that BA was using at the time.
"When organisations take poor decisions around people's personal data, that can have a real impact on people's lives. The law now gives us the tools to encourage businesses to make better decisions about data, including investing in up-to-date security," said Information Commissioner Elizabeth Denman.
British Airways said it had alerted customers as soon as it had found out about the attack on its systems.
"We are pleased the ICO recognises that we have made considerable improvements to the security of our systems since the attack and that we fully co-operated with its investigation," said a spokesman.
Data protection officer Carl Gottlieb said that in the current climate, £20m was a "massive" fine.
"It shows the ICO means business and is not letting struggling companies off the hook for their data protection failures," he said.