|US Open 2019|
|Venue: Flushing Meadows, New York Dates: 26 Aug – 8 Sep|
|Coverage: Live text and BBC Radio 5 Live Sports Extra commentary on selected matches on the BBC Sport website and app. Click here for Live Guide.|
Williams, 37, took control midway through the second set to win 5-7 6-3 6-1.
The eighth seed dropped just five points in a one-sided final set.
The 23-time Grand Slam champion will play Czech Karolina Muchova or Taiwan’s Hsieh Su-wei in the third round.
Williams thrashed long-time rival Maria Sharapova in the opening round on Monday, but was given a much sterner test by McNally on the 17-year-old’s first main-draw appearance at Flushing Meadows.
McNally, ranked 121st in the world, constructed some excellent points as she tried to move Williams around the court and it proved successful when she claimed the first break point of the match for a 6-5 lead.
- GB’s Konta & Evans delayed by rain
- Federer beats Dzumhur to make third round
- Svitolina and Pliskova through to last 32
- Nishikori battles past Klahn
- Jamie Murray column: Steaks, Skupski and the Great Wall of Noob
After fighting off three break-back points, McNally sealed the set at the second attempt to move halfway to a famous victory against one of the all-time greats, who had already won the 1999 US Open before McNally was born in November 2001.
Eventually Williams found a level closer to her best, breaking for a 4-2 lead in the second set and levelling after missing four set points on McNally’s serve.
The final set was a different story to the previous two, Williams winning 16 of the opening 17 points and needing little over 20 minutes to clinch victory.
Earlier in Wednesday’s night session, Australian second seed Ashleigh Barty battled past American Lauren Davis in straight sets.
The French Open champion, 23, saved a set point in the second before taking her fourth match point to win 6-2 7-6 (7-2) on Louis Armstrong Stadium.