From the off, the pair tussled on the court as seven break points between them were pulled up before one was actually taken.
It was Konta who snatched the first break, but Muguruza responded with her own snatch of serve and the first set was eventually taken into a tie-break.
After 80 minutes of play, Konta was able to take a one-set lead when Muguruza's return floated long to give the Brit a 7-4 win in the tie-break.
The second set was a close contest once again, and Konta was tested heavily in her second service game as Muguruza battled to four break points, but she failed to convert any.
From that point on, both players held serve until Muguruza struck at a vital time to break thanks to a double fault from her opponent.
However, Konta was able to respond by snatching serve instantly, and the set was eventually sent into another tie-break, which Muguruza was able to clinch, but not without controversy as the Brit was furious when her opponent's challenge for an out call was granted.
It was the perfect start to the third and final set for Konta as she moved into a 3-0 lead, but her Spanish opponent was lifted when she battled to save four break points, despite not helping herself with a few double faults.
After almost three-and-a-half hours, which is the longest ever women's match played at Flushing Meadows since 1970, Konta was able to see out the triumph and book her place in the next round.