NEW YORK — A bad back prevented Roger Federer from getting ready for the U.S. Open the way he prefers to prepare for a Grand Slam tournament. And it’s showed so far.

Federer blamed a lack of proper practice after making an uncharacteristic 68 unforced errors and being forced to go five sets again before coming back to edge a cramping Mikhail Youzhny 1-6, 7-6 (3), 6-4, 4-6, 6-2 on Thursday in Arthur Ashe Stadium.

It is the first time the 36-year-old Federer has played five-setters in both the first and second rounds at a major tournament.

“I knew I was going to maybe struggle early on. Maybe I struggled more than I would have liked to. But I’m still in the draw, which gives me a chance. I still believe I’m going to pick up my game and become just more consistent because I’m not playing all that bad,” Federer said. “It’s just that I’m going a bit up and down in waves throughout the match.”

Given that Federer entered the day with a 16-0 career record against Youzhny and a 16-0 mark in the U.S. Open’s second round, one might have thought that their match would be a mismatch.

Think again.

“He’s also a real man who plays tennis,” Youzhny noted. “He’s not a god.”

Well, OK, that’s true. But remember: Federer did not drop a single set en route to his record eighth Wimbledon championship in July. And that he is 37-3 with five titles, including two at majors to raise his record total to 19.

Second on that list, with 15, is No. 1-seeded Rafael Nadal, who trailed by a set and a break before figuring things out and beating 121st-ranked Taro Daniel of Japan 4-6, 6-3, 6-2, 6-2 in Ashe at night. That followed 20th-seeded American CoCo Vandeweghe’s 7-6 (6), 6-2 victory over Ons Jabeur of Tunisia under the lights.

What already was a wide-open women’s bracket became more so when 2004 U.S. Open champion Svetlana Kuznetsova was upset by 116th-ranked Kurumi Nara of Japan 6-3, 3-6, 6-3. The No. 8-seeded Kuznetsova’s exit means five of the top eight women are already gone.

The No. 3-seeded Federer won five consecutive U.S. Open championships from 2004-08 and also was the runner-up twice, including two years ago. But he missed last year’s tournament while taking off the second half of the season to let his back and surgically repaired left knee fully heal.

That back, an off-and-on issue for years, flared up again while Federer was losing in the final of the Montreal Masters in August. He didn’t get to fully work on returns or serves, in particular, as the U.S. Open approached. That lack of training and the resulting lack of timing — rather than pain from his back — is what Federer said caused him problems Tuesday night in the first round against 19-year-old American Frances Tiafoe and again against Youzhny, a former top-10 player who reached the 2006 and 2010 U.S. Open semifinals but is now ranked 101st.

“I’m pretty confident that I’m only going to get better from here. That’s a good thing,” Federer said. “Because I’ve played a lot, I definitely found some rhythm now.”

He did falter repeatedly Thursday, though.

Federer let a lead slip away in the second set and got broken while serving for it at 5-4.

“He helped me to come back,” Youzhny said.

Federer stumbled again while serving for the fourth set at 5-3, but responded to a break there by breaking right back.

Still, Federer’s unforced errors continued to mount in the fifth set — 11 in the first four games alone, including a badly shanked forehand on his first break point at 2-1, a netted backhand on his second, and a long forehand to let Youzhny hold there. Eventually, Federer nosed ahead, aided by the considerable dip in the 35-year-old Youzhny’s level of play.

While Federer played his first-round match Tuesday under the roof in Ashe, Youzhny’s opener was postponed until Wednesday because of rain, and he blamed that for his fatigue. His legs started cramping late in the third set Thursday and then reached other parts of his body, even his fingers, by the end. That made it hard to move forward or to jump normally while serving.

At 1-all in the deciding set, Youzhny collapsed to the court, grabbing at his right leg after whiffing on an attempted swat at Federer’s lob. Youzhny stayed down for a few moments, then grimaced and limped around for the rest of that game.

Afterward, Youzhny chuckled at the mention of having lost all 17 matches against Federer, even leaning back in his chair and joking about how he would have completed the upset if Grand Slam rules were different: “I beat him in three sets now — but we played five sets. But come on, if we played three sets, I already beat him!”

Federer, naturally, preferred to look at matters from a different perspective.