The Matildas will meet Denmark to decide third place at the Algarve Cup in Portugal, after goals by Emily Gielnik and Ellie Carpenter fired them to a win over China and a top finish in their group.

Australia came from behind to defeat China 2-1 on Tuesday (AEDT) to end the pool stage with two wins and a loss in the invitational tournament.

Their cause was helped when group C rivals the Netherlands bagged a surprise 1-0 win over Sweden.

The Matildas will meet world number 15 Denmark on Thursday (AEDT) after it smashed Russia 6-1 to finish second behind Canada in their group.

The Canadians will meet Spain in the final, with the top two teams from across the three groups advancing directly to the decider.

On Monday, a goal from super sub Gielnik and then the winner from 16-year-old Carpenter lifted the world number six Matildas past China who had led 1-0 at the break.

In a tough test for the Australians, China sat back and played counter-attacking football while the Matildas pressed hard but found goals difficult to come by.

China's patience was rewarded when Wang Shanshan was played in at the 36-minute mark to give China the lead against the run of play.

Gielnik was introduced in the 59th minute by coach Alen Stajcic and got her equaliser two minutes later, smashing home Emily van Egmond's cross to level the scores at 1-1.

It was Gielnik's third goal of the tournament after a brace in the 3-2 win over the Netherlands.

Then it was Carpenter's turn, the teenager bagging her first Matildas' goal as she headed home a Van Egmond corner to make it 2-1 with six minutes remaining.

Earlier in the tournament, Australia lost its opening match to Sweden 1-0 before beating the Netherlands 3-2.

AAP