FRANKFURT — Sometimes it is hard to tell where the German government ends and the auto industry begins.

Daimler and Volkswagen’s top lobbyists were once close aides to Chancellor Angela Merkel. The foreign minister, Sigmar Gabriel, used to sit on Volkswagen’s supervisory board. Ms. Merkel herself once buttonholed the governor of California to complain about the state’s strict emissions standards.

Those close relations between public officials and car manufacturers were once considered vital economic policy for Germany’s most important export. Now, they are a political liability.

Weeks before national elections, voters increasingly see the government as complicit with carmakers in a widening diesel crisis that threatens the German economy. While Ms. Merkel is still heavily favored to win, the chancellor and her political rivals consider the automakers toxic and have begun to distance themselves from them.