Substitute Lukas Jutkiewicz hit a last-minute winner for Birmingham as they ended their goal drought in a 2-1 victory over Huddersfield at St Andrew's.
Fellow sub Isaac Mbenza looked like he had rescued a point for Huddersfield after equalising in the 85th minute after Gary Gardner ended Birmingham's 322-minute spell without a goal.
Mbenza's stunning 85th-minute free-kick rewarded a dominant second-half performance from Carlos Corberan's side until Jutkiewicz handed Blues a first victory in seven matches.
Scott Hogan and George Friend both went close twice, while Jeremie Bela hit the post for the home side.
Jutkiewicz's winner was Blues' first in open play in 2020-21, with all of their previous goals from set-pieces.
After a slow start to the game by both teams, Blues created four quick chances in as many minutes.
A low free-kick from Ivan Sanchez reached Gardner at the far post, but the midfielder mis-kicked in a crowded box and Huddersfield cleared.
Seconds later, Hogan drove a couple of feet wide from 25 yards before the striker toe-poked wide when clean through after an error by Christopher Schindler was seized on by Sanchez.
Blues remained in the ascendancy and Friend cut inside before firing low straight at goalkeeper Ben Hamer at his near post.
Huddersfield produced their first attempt in the 24th minute when Fraizer Campbell's shot on the turn from 25 yards flew narrowly over the bar.
But Blues returned to the attack to deservedly break the deadlock three minutes later.
A free-kick from Bela, this time floated high into the box, was met by a powerful header from Gardner at the far post that looped over Hamer, who had no chance of saving.
Blues continued to threaten and a curling free-kick from Bela hit the base of the post before Friend's follow-up was cleared off the line by his former Wolves team-mate Richard Stearman.
Huddersfield's only other chance of the first period came when Josh Koroma headed wide from a tight angle after goalkeeper Neil Etheridge missed Juninho Bacuna's free-kick.
Huddersfield had the first opportunity of the second half when Koroma seized on a poor headed clearance, cut inside and unleashed a fierce shot that crashed off the bar, with Adama Diakhaby unable to hit the target from the rebound.
Mbenza curled a brilliant free-kick into the top corner to equalise from just outside the box.
But Jutkiewicz, who missed two games after testing positive for Covid-19, secured Blues' win when he tapped home the rebound after fellow substitute Jonathan Leko smacked the bar with an angled drive.