In his past three starts, James Paxton has pitched 18 innings. He has struck out 21, walked four, given up just five runs. And, somehow, on Monday night, the Yankees lost their third of those three games.

“It’s — ” Yankees manager Aaron Boone started in explaining the loss, then paused, cleared his throat, and started again. “Obviously games like this, they got a very good team.”

Instead of talking Paxton’s turnaround, Boone answered questions about Aroldis Chapman’s ninth-inning collapse. Minutes later, Paxton stood in front of a backdrop smattered with Yankees logos, speaking in the soft tones that accompany a loss.

“I thought it was a step in the right direction,” he said. “The last few have been pretty good. Throwing the ball well.”

But despite Paxton’s performance, and despite a late-inning comeback that seemed to validate it, Chapman let up a three-run homer in the ninth to Travis d’Arnaud as the Yankees fell to the Rays, 5-4. Paxton got a no-decision — but that matters little.

What does matter is that, against a division rival looking to make up ground, Paxton tossed six innings of two-run ball, making two mistakes against d’Arnaud and otherwise looking in control. What matters is he struck out batters — seven on the night — with a mix of his fastball, slider and knuckle curve. What matters is he worked out of a jam in the sixth by striking out Kevin Kiermaier and inducing a Guillermo Heredia pop-up, calmly walking back to the dugout as the Rays’ right fielder let out his frustration.

What matters is that Paxton put the Yankees in a position to win, and if he keeps pitching like this, they will, Monday’s frustrations aside.

Paxton’s season has been inconsistent or disappointing, depending on the harshness of your characterization. His 4.01 ERA coming into Monday was on track as a career-worst; his ERA in June was a lofty 7.15.

It is no secret the Yankees are looking for starting pitching at the trade deadline. An improved Paxton would be a big step to filling that hole, and Paxton looks, well, improved.

When the Yankees shipped three prospects, including Justus Sheffield, to Seattle in November, this was what they had in mind.

“I think my breaking ball was better,” Paxton said. “I was able to locate the backdoor cutter a little bit better tonight. Fastball wasn’t as good as last game, but it was still pretty good. And I feel like I’m making strides with my breaking ball. My curveball as well.

“So, it’s slowly starting to come together.”