BMW has so far been able to make up for a global shortage of semiconductors but will now start to feel the effects.

German car giant BMW posted record profit of 4.8 billion euros for the second quarter on Tuesday, but warned the second half of the year would "likely" be affected by semiconductor shortages.

The Bavarian company has so far been able to make up for a global lack of supply in this essential component but will now start to feel the effects.

"The longer the supply bottlenecks last, the more tense the situation is likely to become," the financial director Nicolas Peter said in a .

"We expect production restrictions to continue in the second half of the year and hence a corresponding impact on sales volumes."

An increase in the price of raw materials is also "likely to impact" the second half of the year.

BMW's record earnings for April to June arose partly because a fine from the European competition authorities in July came in one billion euros ($1.2 billion) below the what was expected and was recorded as a in the results.

Brussels issued BMW and Volkswagen with the fine for colluding on the development of anti-pollution technology for diesel cars.

Daimler, which participated in the wrongdoing but alerted authorities to it, was spared any penalty.

A significant increase in sales as the economy began to bounce back from the coronavirus pandemic also helped lift the figures.

In comparison, the company posted a loss of 212 million euros in the of 2020, when the pandemic halted trade and travel worldwide.

The division's operating margin for the year is therefore forecast to touch the "upper end" of the range between seven and nine percent, up from the six to eight percent previously expected.

In the first half, this closely watched figure reached 13 percent, well above the figure of negative four percent recorded for 2020.

Revenue was up by 43 percent year-on-year for the period April to June and up 28 percent to 55.4 billion euros in the first half.