For tennis’ two biggest stars, Roger Federer and Rafael Nadal, the image that fits their play through the first week of this U.S. Open is of needing one of those “In case of emergency, break glass” boxes nearby.

Both have looked vulnerable at times in their matches, completely out of context with their 2017 results, which include Federer’s titles at both the Australian Open and Wimbledon and Nadal’s record 10th French Open championship in Federer’s absence.

The anticipation was that the sport’s most dominant male players of the 21st century finally would square off at the Open — and at the top of their games, despite advancing age. Federer, 36, and Nadal, 31, oddly never have dueled in Flushing Meadows, though they have tangled 12 times in the other three Grand Slams — five times at the French, four in Australia and three at Wimbledon.

But Federer arrived in New York with concerns about a back problem that caused him to withdraw from the Mason, Ohio, tuneup event in mid-August, and Nadal said that he hasn’t found the same level of competence in matches as he feels in training sessions.

Federer needed five sets to win each of his first- and second-round matches here, something he never had experienced in his previous 70 major-tournament appearances.

Being cautious about his back, Federer said his “preparation hasn’t been the best. It’s a big compromise, knowing I might struggle early on but still hope to get thorough the early rounds somehow.”

Nadal, who always plays with a furrowed brow, has displayed a whole body language of worry through the first set each time out. But he eventually wore down the world’s 85th-ranked player, Dusan Lajovic of Serbia, and 121st-ranked Taro Daniel of Japan before Saturday, when he slowly built steam against 30-year-old Argentine Leonardo Mayer, who was in the Open only via the Lucky Loser provision.

advertisement | advertise on newsday

Mayer’s ranking at the mid-July deadline for automatic Open entry was too low, and his loss in the qualifying tournament would have left him out of the tournament if not for injury withdrawals.

Still, before Nadal recovered for a 6-7 (3), 6-3, 6-1, 6-4 victory under the Arthur Ashe Stadium roof in the last of Saturday’s scheduled afternoon matches, Mayer made him work through so many tough, long rallies that they played 100 minutes past the 7 p.m. starting time for Federer’s night session match.

That meant that thousands of night ticket holders were locked outside the Ashe to wait. In the rain. And it meant that Federer didn’t get on the court until almost 10 p.m. for his eventual 6-3, 6-3, 7-5 victory over No. 31 seed Feliciano Lopez of Spain — Federer’s first glimpse of control in the tournament.

“The matches have been very, very tight,” Nadal said. “I don’t know how many break points I had before I finally got one.” It was 14. “I’m very happy and I have to play better now.”

For Open officials, the good news was that all other day singles matched were completed before the rain started. In the men’s draw, No. 6 Dominic Thiem, No. 24 Juan Martin del Potro and No. 33 Philipp Kohlschreiber all won in straight sets, while No. 9 David Goffin advanced when No. 18 Gael Monfils retired in the second set.

@NewsdaySports

Joining them in the quarterfinals will be Ukraine’s Alexandr Dolgopolov, ranked 64th, and Russia’s 19-year-old Aubrey Rublev, ranked 53rd.

Meanwhile, Federer and Nadal, either were tempting fate or just adding drama.