FRANKFURT, Germany (AP) — Xabi Alonso scored a spectacular goal for Bayern Munich to beat Darmstadt 1-0 and earn a place in the German Cup quarterfinals on Tuesday.

Alonso controlled a corner with his right foot and fired a drop kick into the upper corner for the only goal closing on halftime.

Bayern labored to overcome a well-organized Darmstadt, and did not create many chances against the Bundesliga newcomer.

Werder Bremen won 4-3 at Borussia Moenchengladbach to reach its first quarterfinal in six years. Bayer Leverkusen also advanced, by beating fourth-tier Unterhaching 3-1.

Second-division Heidenheim beat third-tier Erzgebirge Aue 2-0 to make it to the quarterfinals for the first time.

Bayern stayed on course for three titles this season thanks to the well-taken Alonso goal from about 25 meters. Robert Lewandowski also hit the post but Bayern made little out of its near monopoly of possession. Late in the match, Darmstadt threatened a couple of times but never put Bayern in real danger.

"You have to take your early chances against such a defending team," Bayern director Matthias Sammer said. "We were not that fresh."

With six German Cup titles, Werder Bremen was second only to Bayern, which has won 17 out of 20 finals.

Lars Stindl put 'Gladbach ahead before Janek Sternberg and Jannik Vestergaard turned the match after the break. Branimir Hrgota pulled one back for Moenchengladbach, but Claudio Pizarro and Anthony Ujah in a three-minute span secured Bremen's victory. Hrgota got his second in injury time but it came too late to matter.

Moenchengladbach dropped to its third consecutive defeat across all competitions, and has conceded 13 goals in those three matches.

Leverkusen had to come from behind against Unterhaching. Javier "Chicharito" Hernandez scored his 18th goal in 21 matches for Leverkusen, and Stefan Kiessling and Karim Bellarabi added the others.

Leverkusen lost the Bundesliga championship by going down in Unterhaching on the final day of the season in 2000.

Maximilian Bauer gave the now fourth-tier Unterhaching a glimmer of hope before the visiting Leverkusen stars replied.