The aircraft made a detour less than 75 miles into its flight to Nigeria.
The BA flight BA83 left Heathrow at 10.30 pm.
The airline said technical problems were discovered by the pilots.
In a statement, BA said: “Our aircraft returned to Heathrow and was met by the emergency services as a precaution after experiencing a minor technical issue.
“Our teams looked after our customers last night, providing them with overnight accommodation. We’re sorry to our customers for the delay in their travel plans.”