"Deutsche Lufthansa AG and International Consolidated Airlines Group have reached an agreement in principle on the sale of British Midland to IAG," the German carrier said in a statement.
"It is envisaged that the purchase agreement will be signed in the coming weeks," said Lufthansa's director of investor relations Frank Hülsmann in a telephone news conference.
"The aim is for the transaction to be completed in the first quarter of 2012," he added.
In the meantime, the two sides had to hammer out the precise details of the sale, including price. IAG would have to examine BMI's accounts and the deal will be subject to the approval of the regulatory authorities.
"We have already approached the EU Commission," Hülsmann said. Media reports said Virgin Atlantic had also been interested in buying British Midland (BMI) because of its attractive slots - take-off and landing rights - at London's Heathrow airport.
But Hülsmann declined to comment, saying only that "during the negotiations, it was IAG that offered the better perspectives, both from BMI's and Lufthansa's point of view."
IAG would acquire all of BMI, including the slots, Hülsmann said. Lufthansa acquired the British airline in 2009, but the recent crises and conflicts in the key regions of North Africa and the Middle East prevented the German carrier from steering the unit back into profit.
In the first nine months of this year, BMI flew in an operating loss of €154 million ($212 million), compared with a loss of €90 million a year earlier.
Together, BMI and British Airways would hold 51 percent of slots at Heathrow, according to the business daily Handelsblatt.
Analysts put BMI's estimated value at £400 million (€463 million), the newspaper added.
In London, IAG, which comprises British Airways and Iberia, said high fuel costs caused after-tax profits to decline to €267 million ($368 million) in the three months to September, from €362 million a year earlier.
In Frankfurt, Lufthansa shares were showing a loss of 0.77 percent, while the overall market was down only 0.30 percent.