Like it or not, the Russian meteor Daniil Medvedev will play in Sunday’s U.S. Open men’s final. And he’ll face arguably the most well-liked, gentlemanly warrior in tennis history, Rafael Nadal.

The rematch of Nadal’s August rout of Medvedev is on. Nadal pulled a Houdini act in the first-set tiebreaker of Friday’s semfinal, rallying from 4-0 down and two set points to end the ambition of the 23-year-old upstart Matteo Berrettini with a 7-6 (8-6), 6-4, 6-1 victory.

Arthur Ashe Stadium rocked as loud as it had all fortnight while watching the 33-year-old Spanish Bull fight to steal the tiebreaker from the hard-serving Italian, who wilted in the final two stanzas.

“I didn’t want to be in a tiebreak against a player like Matteo,’’ Nadal said in his post-match interview on the court. “I was a little lucky. It was 4-0 and it was 95 percent his. I survived at that moment. I just tried to stay focused on the next point. You see 4-0, you see things very far.”

One more triumph and Nadal will climb to 19 Grand Slam titles, moving very close to Roger Federer. The Swiss Maestro has a record 20 Slam championships.

While the boos have stopped for Medvedev, Nadal should have the bulk of the crowd support as he goes for a fourth Open title — also one behind Federer’s five.

A villain earlier in the tournament for surreptitiously giving the middle finger to the Open crowd, the No. 5 seed Medvedev continued his scorching summer on a cold, rain-infested day with the roof closed over Ashe Stadium.

Medvedev took advantage of two days of rest to heal a quad injury and straight-setted baseliner and Federer slayer Grigor Dimitrov of Bulgaria, 7-6, 6-4, 6-3, in the first semifinal. Medvedev was booed in his prior three matches, but only heard cheers Friday.

“I would be surprised [if I’m booed Sunday], but I would have to take the energy and go again with this energy,’’ said Medvedev, who trolled the crowd after hearing boos in two early-round matches. “I’m not proud of what I did. I’m working to never do it again.”

Medveved’s lone tennis slipup this summer was to Nadal in the finals of the Rogers Cup in Montreal last month — when he was crunched 6-3, 6-0. But he now has reached four straight finals and seems primed to become the fourth-biggest name in men’s tennis after the so-called Big Three.

“Coming to the USA [this summer], I didn’t know it would be that good,’’ Medvedev said. “I have to say l love USA.’’

As far as tackling Nadal, Medvedev said: “He’s just a machine, a beast on the court. The energy he’s showing is just amazing.”

The first-set tiebreaker that Nadal pulled out was one for the ages, with Berrettini playing forceful tennis. Nadal, who will appear in his 27th Grand Slam final, has made a career of rallying from behind in tiebreakers.

Berrettini, leading 6-4, got tight, hitting the tape on an approach shot, putting a low backhand volley into the net and muffing a drop shot. Nadal was on his way to four straight points.

Nadal, up 7-6, just wouldn’t miss, outlasting Berrettini in a ferociously long baseline slugfest.

The fans serenaded the two foes with a standing ovation after a 73-minute set.

Berrettini ran out of gas in the final two sets and Nadal never faced a break point all match.

“Great future in front of him,’’ Nadal said.

The Medvedev-Dimitrov semifinal was a sturdy baseline war from the opening rally, which lasted 20 strokes. Medvedev was just craftier, more consistent. The 6-foot-5 rising star doesn’t bang the ball, but he hits enough different spins and angles to win.

Medvedev, 23, has terrific court coverage with his long wingspan, can resemble a brick wall when locked in and may just give Nadal a Sunday test. This was Medvedev’s first major semifinal appearance and he showed no nerves — and his leg injury proved no factor.

“He’s making steps forward every single week,’’ Nadal said. “He’s the toughest opponent for the final. I need to be playing at my best.’’