It was harder than expected, but Roger Federer overcame a shaky start to his 19th United States Open on Monday night.

After dropping the first set and causing worry among his fans in Arthur Ashe Stadium, an unshaven Federer defeated the 22-year-old qualifier Sumit Nagal of India, 4-6, 6-1, 6-2, 6-4, in 2 hours 30 minutes.

“I thought I played like my beard today,” Federer said in an on-court interview. “I was rusty.”

Federer, who won his five U.S. Open titles from 2004 to ’08, has never lost in the first or second rounds of the main draw of the event since he began playing it in 2000. But he looked to be in considerable danger after Nagal, who is ranked No. 190 in the world, grabbed the first set amid 19 unforced errors by Federer — and almost as many looks of frustration and dismay.

Monday’s scores: Men | Women

While Federer was out of sorts early, Nagal hit strong, confident ground strokes, pushing Federer back on his heels. But in the second set, Federer regained his normally exquisite form and quickly squashed the challenger’s hopes.