In a tough opening set, Bartoli was broken on her first service game before she found two breaks against the Slovenian to take the initiative.
However, the momentum was soon back with Hercog as another break levelled the set.
As the players edged towards a tie-break, Hercog stunned Bartoli by taking another service break to claim the set 7-5.
While the competitors were close in the first, the world number seven came out fighting instantly in the second as she broke Hercog's first service game.
Bartoli was rarely troubled after that as she earned another break to take the set 6-2.
Despite losing a service game, the former Wimbledon finalist broke four times in the deciding set on her way to a 6-1 victory.