CINCINNATI, OH, USA -- Madison Keys of the United States fought through a closely-contested first-round match before overcoming 2017 champion Garbiñe Muguruza of Spain, 6-7(4), 7-6(5), 6-4, at the Western & Southern Open on Tuesday.

Keys improved her career record against Muguruza to 3-1 after prevailing on a toasty afternoon in two hours and 20 minutes of grueling groundstroke play. The American snapped a three-match losing streak, having attained her most recent victory over Luksika Kumkhum in the first round of Wimbledon.

"It’s really great," Keys said, after her win. "Obviously losing last week in two tiebreaks in the last two sets was really, really tough, so being able to get that second set and then closing it out without going to a tiebreak in the third was really great."

GALLERY: Snapped in Cincy: All the best photos on and off the court

Keys was thrilled to move through after her first-round loss to Donna Vekic in Toronto the week prior. "Even last week, I fought really hard to stay in that match, and did my best, and I could have gone away after not closing it out," said the 2017 US Open finalist. "I’m proud of how I handled that situation, but it also feels really good to get a win today."

Keys slammed 56 winners, including 13 aces, and 52 unforced errors during the match, while Muguruza fired just nine winners to 25 unforced errors in total. Keys was more effective winning points on her second serve, with 55 percent efficacy to Muguruza's 42 percent.

World No.18 Keys will now face either Daria Kasatkina of Russia or lucky loser Barbora Strycova of the Czech Republic in the second round.

"Either way it’s going to be tough," said Keys. "Obviously they both have different strengths, but they both play kind of crafty and change the pace and all that. Honestly, I think no matter who wins, it’s a similar game plan, but it’s going to be tough no matter what."

Keys had three break points in Muguruza’s opening service game, but the American fired returns into the net on each of those chances, and Muguruza was able to obtain a hold for 1-1. Keys then had to fend off a break point at 3-3, but she erased that with a forehand winner before holding for 4-3.

Muguruza then went up a break, clinching the 5-4 lead with, surprisingly, her first winner of the match. But Keys broke right back for 5-5, leveling the set by converting her second break point of the game with a backhand winner down the line.

The duo advanced to the tiebreak, where Keys led 3-1 after a backhand winner down the line. But errors from the American started to pile up, and Muguruza claimed six of the last seven points to eke out the first set. Muguruza had only two winners in the first set, but also just five unforced errors, while Keys had 27 unforced errors in the first stanza.

In the second set, Muguruza double faulted her first service game away, giving Keys an early 2-1 lead, but the Spaniard again broke back straight away, this time at love, to tie the set at 2-2. Neither player held or faced a break point for the rest of the set as the combatants inexorably moved to another tiebreak.

Muguruza edged closely to a straight-set victory as she gathered a 4-1 lead in the breaker. However, Keys came up with some clutch serves on important points to pull herself back level at 5-5. There, another solid Keys serve set up a backhand winner, which gave the American a set point at 6-5. Keys converted that chance with a fiery forehand, and the match was all square.

"Honestly, it was just ‘You better go for it, because if you don’t, you’re gonna go home,'" Keys laughed, whe explaining her thoughts during the second-set tiebreak. "'Are you gonna go for it and see what happens, or are you gonna go home later today?’”

An early exchange of breaks in the first two games of the decider did little to separate the pair, as they stayed in lockstep through 4-4. Keys, though, had a commanding service game to hold for 5-4, with multiple fierce winners and an ace, maintaining her momentum as the match neared its conclusion.

Finally, Keys saw her chance in the subsequent game when a rash of errors by Muguruza quickly put the Spaniard down 0-40, giving Keys three match points. On her second opportunity, Keys crushed a return winner past Muguruza, and the American found herself back in the winner’s circle for the first time since Wimbledon.