South Korea's transport ministry said it will ban certain BMW models because of a fire risk. A vintage BMW logo is pictured on Mar. 7, 2016 in Munich, Germany. Lennart Preiss/Getty Images

South Korea's transport ministry on Tuesday announced it will ban roughly 20,000 BMW vehicles from the road because of a fire risk due to a flaw in the exhaust system.

The ban covers vehicles that have not yet been inspected by BMW’s safety group, the transport ministry said. Owners with affected cars are only allowed to drive it to an inspection site where it can be cleared upon tests.

Videos have circulated the internet of BMW cars in flames.

The South Korean government says it is investigating BMW consumer complaints.

"I am asking owners of the BMW cars subject to the recall to actively cooperate to prevent bigger accidents, despite your inconvenience," Transport Minister Kim Hyun-mee said at a press conference.

News of the ban comes amid public concern as nearly 40 engines have erupted in flames between January and July. Those fires have mostly occurred inside the BMW’s 520d models.

Kim Hyo-joon, chairman of BMW Korea on Aug. 6, issued a public apology regarding the system flaw.

BMW said it would replace the EGR coolers and modules in the faulty cars across 42 models starting Aug. 20. That covers models made between 2011 through 2016.

The company said it had reserved 14,000 vehicles to lend to those affect by the recall until it resolves the issue. It has voluntary recalled 323,700 of its cars in Europe over safety concerns with about 96,000 of those cars in Germany.

During its second-quarter, BMW had a second-quarter profit of $2.43 billion after taxes this year, compared to $2.58 billion during the same time last year.

Shares of BMW (BMW.DE) were down 1.38 percent on Wednesday afternoon.