Michael A. Taylor steals second during the Nationals’ win over the Phillies on Thursday night. (Nick Wass/AP)

A couple weeks after leaving Houston just before Hurricane Harvey made landfall, the Nationals departed Miami on Wednesday night as the region braced for Hurricane Irma. They arrived in dry Washington early Thursday morning with a second consecutive division title in sight to play the final four of their 21 games in 20 days, Monday’s day off providing a light at the end of a grueling stretch.

By then, Washington could, mathematically, have clinched the National League East title. The magic number was six entering Thursday, meaning any combination of six Nationals wins and Miami Marlins losses would secure Washington the division crown. The celebration will almost definitely take place sometime during Washington’s 10-game homestand and could happen as early as Saturday night after the Nationals defeated the Philadelphia Phillies, 4-3, at Nationals Park and the Marlins lost minutes later to shrink the magic number to four.

“It was a good one for us to win,” Nationals Manager Dusty Baker said. “We just got to keep rolling.”

The Nationals (86-54) took the first of four games against the Phillies, owners of the worst record in baseball, behind another solid outing from Tanner Roark, some timely hitting late and more shutdown performances from their midseason bullpen acquisitions.

Roark’s curveball, a pitch he has relied on more than ever this season, betrayed him in his six innings. The Phillies (53-87) recorded two of their three runs against Roark off that pitch. In the third inning, Phillies catcher Jorge Alfaro smacked a hanger for a 104.5 mph line-drive home run to left-center field — the third home run Roark has allowed off his curveball this season but second in two starts.

In the fifth, shortstop Cesar Hernandez, distinguished Nationals nuisance, smacked a curveball for an RBI single. In between those, Tommy Joseph launched a moonshot that landed just over the left field wall for a solo home run. It came on a four-seam fastball.

But that was all Roark gave up on seven hits. He walked off the mound in the sixth inning with six strikeouts to one walk at 100 pitches.

“I felt like I was just barely missing with a couple curveballs and change-ups early and then settled in,” Roark said. “One of those games where you just got to battle with all your stuff, and we came out on top.”

Roark, however, departed on the hook for the loss with the Nationals trailing, 3-1, though that soon changed when the Nationals finally broke through against right-hander Aaron Nola.

Adam Lind initiated the charge with a single. Two batters later, after Lind took second base on a wild pitch and third on a passed ball, Matt Wieters crushed a 3-0 fastball from Nola to left-center field for an RBI double. Left-hander Adam Morgan entered to face Alejandro De Aza, a left-handed hitter, before Howie Kendrick, a right-handed hitter, was inserted to pinch-hit for him. Kendrick walked, and Rafael Bautista followed with a single to load the bases.

That brought up Trea Turner, who entered the at-bat against Morgan with a .192 batting average and .504 on-base-plus-slugging percentage in 78 plate appearances against left-handers — puzzling production for a right-hander hitter. The shortstop delivered anyway, slashing a two-run single up the middle to give Washington a 4-3 lead.

“The first couple at-bats I feel like I had some pitches to hit and didn’t capitalize,” said Turner, who played in his 10th game since returning from a broken right wrist. “He threw two tough pitches in the first two and then got the third one in the middle of the zone and put a good swing on it.’

The outburst set the stage for Washington’s three-pronged relief machine. It was unleashed in order, starting with Brandon Kintzler in the seventh inning. The right-hander logged a perfect frame with the help from a leaping catch at the wall in center field by Michael A. Taylor to rob Andres Blanco of extra bases for the first out.

“Michael Taylor saved the game on that home run he took way,” Baker said. “That was a tremendous play. You’re used to seeing Michael do things like that in center field. He’s becoming one of the best in the business.”

Ryan Madson emerged next. He worked around a single to tally another scoreless inning — the 12th straight to begin his Nationals career. Sean Doolittle was summoned for the ninth to make quick work of the Phillies. He discarded the side in order, punctuated by a strikeout of Blanco, to notch his 16th save in a Nationals uniform and pull Washington closer to another division title.

Read more on the Nationals/MLB:

Braves apologize for playing ‘Rock You Like a Hurricane’ during game against Miami

J.D. Martinez, Robbie Ray have the Diamondbacks looking like NL’s scariest team

The Dodgers have a lot of starting pitchers. And come October, they’ll all be fresh.

How Chad Green went from middling Yankees starter to top-rate reliever, seemingly overnight