The 47-year-old left the John Smith’s Stadium following weekend discussions with the board.
Wagner, who took the Terriers into the Premier League and then kept the club there against all the odds last season, had initially suggested standing down in the summer due to needing a break from football management.
However, it was later decided between both parties that a clean break was needed and Under-23s coach Mark Hudson will take charge of Sunday’s home match with champions Manchester City.
“Together we have achieved unbelievable things; we made the dream of Premier League football for Huddersfield Town a reality,” wrote Wagner in an open letter to the club’s supporters.
“That only happened because of this incredible togetherness that was unique to this club.
“I am sad to be leaving, but I am immensely proud of what we have achieved at Huddersfield Town. This club is now in my heart and ultimately I want what is best for its future.”
Huddersfield’s search for a new head coach is already under way. Hudson will definitely take the team on Sunday against the champions and then Town’s board have a nine-day window before the next game, at home to Everton, to make an appointment.
Chairman Dean Hoyle built up a strong relationship with Wagner and had previously said the German would see the season out regardless of how results went.
But the Terriers’ chief has always had in mind what direction the club should take post-Wagner.
A short-term ‘fire-fighting’ appointment was never in his thinking despite Sam Allardyce being made the early favourite by the bookmakers to take charge.
Talk of David Moyes and Alan Pardew was also easily dismissed for the same reason with Hoyle wanting to bring in someone for the long term.
Allardyce, speaking yesterday, made clear the job was not for him after admitting Huddersfield, eight points adrift of safety, have little chance of avoiding the drop.
“They are rock bottom of the Premier League and I don’t think I could change that situation,” he said. “Huddersfield haven’t got enough goals to get out of trouble.”