TORONTO, ON - AUGUST 10: Ashleigh Barty of Australia hits a shot against Garbine Muguruza of Spain during Day 6 of the Rogers Cup at Aviva Centre on August 10, 2017 in Toronto, Canada. (Photo by Vaughn Ridley/Getty Images)

A gallant Ashleigh Barty has lost to Garbine Muguruza in a third round clash of the Rogers Cup in Toronto.

The 21-year-old Aussie lost 6-0 3-6 6-2 to the Spaniard, conceding the first set in only 21 minutes.

Barty recovered after the worst possible start but could not hold off the world no.4.

After losing the opening set 6-0, Barty switched gears in the second set, breaking her opponent in the fourth and sixth games.

But she could not hold out in the decider, winning only 20 per cent of points on her second serve.

Barty, ranked 58 in the world, previously defeated Muguruza the last time they played at Birmingham in June.

Muguruza will advance to play Elina Svitolina in the quarter-finals after Svitolina's third round win to Williams.

Karolina Pliskova is currently the world No. 1 moving into the final eight.