Linda Caicedo scored a wondergoal to put the South Americans ahead, but Germany levelled with an 89th-minute penalty from Alexandra Popp.
Vanegas then headed Leicy Santos’ corner beyond Merle Frohms, thrilling the large Colombian crowd at Sydney Football Stadium.
It was Germany’s first World Cup group stage loss since 1995.
Caicedo, 18, had superbly curled into the top corner on 53 minutes to surprise the two-time world winners.
The last round of group play begins on 3 August at 11 a.m. BST, with Colombia facing Morocco and Germany facing South Korea.
Colombia needs a point to win the group, while Germany may need to win to guarantee a place in the knockout stages.
“Obviously, you need to be happy and euphoric because this is a great win for the whole country, and we’ve been feeling this,” Colombia assistant coach Angelo Marsiglia said.
“But, look, the game and the tournament are still ongoing, so we’ll take it one step at a time.” We have a mature team that knows what they want.”
Vanegas’s victory creates spectacular scenes
Lina Magull of Germany stated prior to the game that they were prepared for Colombia’s “passion” and roughness – but they received considerably more than they bargained for.
Colombia made the game a real tussle against the two-time world champions, with plenty of midfield battles and heavy challenges, with Germany barely finding any type of rhythm.
Germany thought to have escaped with a point after falling behind to Caicedo’s moment of brilliance when Colombian keeper Catalina Perez fouled Lena Oberdorf and captain Popp slotted away the penalty.
Colombia, on the other hand, had different plans, and it was the odd figure of full-back Vanegas who threw their fans into ecstasy.
Colombia fans turned out in force and volume for their team’s opening victory over South Korea at the same venue, and they did so again today. At the final whistle, Sydney appeared to have been converted into Bogota.
Colombia’s sole concern was centre-back Jorelyn Carabali being carried off on a stretcher in the last seconds after colliding with Popp.
Germany’s unbeaten streak of 20 Women’s World Cup group games, dating back to a 3-2 setback to Sweden 28 years ago, has come to an end.
Far more troubling for them was their defeat by physically and mentally tough opponents, which will raise some worries as they attempt to reach their first final since winning the world title in 2007.
“It’s up to us,” Germany head coach Martina Voss-Tecklenburg remarked. “How we play is up to us, and it is our responsibility to do so.” I’m not concerned that we won’t go through.”
Caicedo’s most recent show-stopper
Caicedo’s career path has been anything but conventional; she made her professional debut at the age of 14 before being diagnosed with ovarian cancer and enduring chemotherapy and surgery at the age of 15.
Her preparation for this game was also rocky. She fell during a training session on Tuesday, but the Colombian camp dismissed the incident as stress and weariness.
Caicedo, who is still only 18, is expected to be a crucial role in Colombia’s assault, and she illustrated why early in the second half with what could be called her “Michael Owen moment.”
At the age of 18, England striker Owen sprinted through Argentina’s defenders to score a spectacular solo goal in the 1998 World Cup.
Caicedo twisted and weaved through a crowd of Germany players in 2023, before curving the ball unstoppably over goalie Frohms.
If the name Linda Caicedo was unfamiliar to the football world before, it is now. And if the football world wasn’t paying attention before, they certainly are now.