New Zealand have their first win at the women's Olympic tournament, but in dramatic circumstances.
They beat Colombia 1-0, the goal coming from Amber Hearn after half an hour.
However the Football Ferns, ranked 17th, seven places higher than the South Americans, finished with 10 players, and survived a late scare to keep themselves alive in the tournament.
Captain Abby Erceg was sent off by referee Gladys Lengwe from Zambia, in an appalling decision after a Colombian attacker tumbled spectacularly just outside the penalty box.
The New Zealand players protested the decision but Lengwe was unmoved. The players got their arms tangled briefly before the Colombian hit the ground.
Goalkeeper Erin Naylor then pulled off a fine one-handed save from the resulting free kick.
The Ferns were worth the win, which gives them three points from two games in their group G.
The format of the tournament, three groups of four teams, has the top two in each pool progressing to the last eight, along with the two best performing third-placed teams.
So the win keeps New Zealand in the frame, going into their final group match against the formidable world No 3 French.
However their problem is the state of the other two groups.
Brazil, Sweden and China all have three points in group E, and the first two named play later today, and South Africa have none.
Canada have six points in group F with Germany four, Australia one and Zimbabwe none.
World No 5 Australia have the fillip of facing Zimbabwe in their last game on Wednesday and would expect to get to four points.
So New Zealand have their hands full with a tough finale.
Still, coming after their disappointing 2-0 loss to the world No 1 United States last week, the New Zealanders will be pleased with the outcome. On rankings, they should have won it too, but the loss of the experienced Erceg is a stinging blow.
The US, who beat France 1-0, have six points in group E. France also have three points, but a superior goal difference to New Zealand, after their 4-0 win over Colombia in their first game. That gives them a +3 difference to New Zealand's -1.