Ketel Marte smacked a bases-loaded single in the ninth inning to drive in the winning run as the Arizona Diamondbacks beat Philadelphia 2-1 on Thursday in the Major League Baseball playoffs.

Marte’s third hit of the game delivered a dramatic walk-off victory that pulled Arizona within 2-1 of the Phillies in the best-of-seven National League Championship Series with games four and five at Phoenix on Friday and Saturday.

“I’m feeling great,” Marte said. “That’s what I’m trying to do every time, doing my best to help the team to get a win.”

At Texas, Jose Abreu blasted a three-run home run and Chas McCormick belted a two-run homer to help the defending champion Houston Astros win 10-3 and level the American League Championship Series at 2-2 with game five Friday at Texas.

“We’re just focused right now,” Houston slugger Jose Altuve said. “We knew when we were down two games the pressure was on our side.

“The thing is looking good right now. Nothing is done yet, but to have the opportunity to come back and to tie the series, it’s really important for us.”

The Astros have won 18 of their past 21 road games, including five of five at Texas.

“It just happens,” said Houston’s Mauricio Dubon. “We come here and focus and everybody does a good job. It’s showing right now.”

At Phoenix, the D-backs avoided falling to the brink of elimination, serving notice after two road losses they were not fading quietly.

“This is our house,” Marte said. “We’re not finished now. We’ve got a great team. We just have to believe in it.”

Deadlocked 1-1 in the ninth, Arizona started with a walk by Lourdes Gurriel, who stole second base and took third on a Pavin Smith single.

Gurriel was thrown out at home on a fielder’s choice by Emmanuel Rivera and Geraldo Perdomo walked to load the bases for Marte’s magical moment, the 30-year-old Dominican second baseman dropping a line drive into centerfield off losing pitcher Craig Kimbrel.

“I was just sitting on fastball and he threw me a fastball first pitch,” Marte said. “I know what kind of hitter I am and he threw me the fastball again and I got the hit.”

Philadelphia opened the scoring in the seventh inning after Arizona’s Andrew Saalfrank walked Bryce Harper and was replaced by D-backs relief pitcher Ryan Thompson.

Harper took second base on an infield hit by Alec Bohm, reached third when Bryson Stott grounded into a double play and raced home for the first run on a wild pitch by Thompson, an off-target slider.

The Diamondbacks answered with their first run in 17 innings in their half of the seventh when Tommy Pham singled and Gurriel drilled a run-scoring double down the left-field line.

A pitching duel dominated the early going as Diamondbacks starter Brandon Pfaadt went 5 2/3 scoreless innings, the American right-hander striking out a career-best nine Phillies while surrendering only two hits.

Philadelphia’s Ranger Suarez, a Venezuelan left-hander, was masterful as well, striking out seven while scattering three hits over 5 1/3 shutout innings.

Astros level AL series

The Astros seized a 3-0 lead in the first inning at Texas.

Altuve hit a leadoff double and took third on a Dubon single. Alex Bregman smacked a two-run triple to centerfield and scored himself on a Yordan Alvarez single — all before the Rangers managed an out.

Adolis Garcia answered for Texas with a solo homer in the second and the Rangers pulled within 3-2 later in the inning when Mitch Garver walked, took third on Nathaniel Lowe’s double and scored on a Josh Jung sacrifice fly.

The Rangers equalized at 3-3 on a solo homer in the third by Corey Seager, but the Astros responded with four runs in the fourth.

Martin Maldonado and Altuve walked and Dubon singled to load the bases. Alvarez drove in a run with a sacrifice fly and Abreu followed with his three-run homer.

McCormick’s two-run blast in the seventh made it 9-3 and Alvarez added a run-scoring single in the eighth for Houston.