|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.|
The world number three hit 17 unforced errors in losing the first set.
But the SWISs five-time champion dominated the remainder of the match to defeat Bosnian world number 99 Dzumhur.
Victory for the 38-year-old sets up a third-round match against either Britain’s Dan Evans or Frenchman Lucas Pouille at Flushing Meadows.
“I just tried to make less errors and be better on the offensive. I was able to protect my serve after a sloppy first set,” Federer said.
“There were some big moments. I came through, buckled down and told myself I was not going to get broken, stayed tough and hung with him and that helps with my confidence for the next match.”
Federer dropped the opening set in his first-round win over Indian qualifier Sumit Nagal and he made another slow start here, losing the first four games of the match.
Although he retrieved one of those breaks, 27-year-old Dzumhur served out the set and held a break point in the opening game of the second set but could not convert.
Federer then immediately broke with a forehand winner and levelled the match through another break when Dzumhur double-faulted.
The SWISs broke at the first opportunity in the second set but had to save four break points in the seventh game as Dzumhur continued to push him.
After sealing the set with an ace, a forehand winner allowed Federer to break in the third game of the fourth set and he went on to seal victory in two hours and 22 minutes.
Federer hit 16 aces to Dzumhur’s two and 58 winners overall – more than double his opponent’s 26.
Play was delayed on the outside courts on Wednesday because of rain in New York, with Britain’s Johanna Konta set to face Margarita Gasparyan when the weather improves. Dan Evans will take on world number 27 Lucas Pouille.