PHOENIX (AP) – On July 18, the Arizona Diamondbacks acquired slugging outfielder J.D. Martinez from the Detroit Tigers for three minor leaguers.

It might go down as one of the best mid-season acquisitions in baseball history.

Martinez has had a thunderous last half to the season, and it only picked up steam down the stretch.

“I’ve never seen anything like what he’s done the last month,” Diamondbacks center fielder A.J. Pollock said. “Yeah, we kind of keep looking, ‘Where would we be without J.D.?’”

In 62 games with the Diamondbacks, Martinez hit .302 with 29 home runs and 65 RBIs, and he has fit in perfectly with the team’s “family” culture nurtured by first-year manager Torey Lovullo.

“It’s been a great couple of months,” Martinez said.

The last month has been spectacular.

In September, Martinez hit .404 (40-for-99) with 16 home runs (tying a National League record), eight doubles, 36 RBIs and 24 runs scored in 24 games.

“It’s a good run I’m on,” he said. “I just want to keep it up and continue in the playoffs.”

Martinez and the Diamondbacks host the NL wild-card game against Colorado tonight.

“It’s cool, it’s a great feeling,” he said of what he’s done in Arizona so far, “but the job’s not done yet. We’ve got one game we’ve got to get in and we’ve got to keep it going.”

Catcher Chris Iannetta said the key to Martinez’s success is the work he does.

“I think no one hits more than him, no one watches more video and studies his own swing, studies opposing pitchers,” Iannetta said.

Lovullo said Martinez’s production at the plate is the result of all that effort.

“The thing that people don’t see is what he does behind the scenes,” the manager said. “There’s notes in a notebook. There’s video and studying. There’s tendencies and habits. There’s constant practice and perfection of the swing. And it translates.”

Combined with his time in Detroit, Martinez hit .303 with a career-high 45 home runs.

“I get a chance to sit next to him or stand next to him before he’s going in the on-deck circle, and it’s the same routine,” Lovullo said. “He does it with his eyes open. He does it with his eyes closed. I know there is a lot of muscle memory that he has perfected. So when he walks up to home plate, it’s just put things in automatic and let it happen.”

Martinez’s September included a fabulous night in Dodger Stadium, when he became the 18th player in major league history to hit four home runs in a game.

“He’s been a huge part of this team, helped us get where we are,” pitcher Patrick Corbin said. “... It feels like he’s going to homer every time at the plate.”

The Tigers got Dawel Lugo, Sergio Alcantara and Jose King in exchange for Martinez, certainly a bargain for arguably the best position player on the market before the trade deadline. And he was just what Arizona needed, a corner outfielder who could bat behind Paul Goldschmidt in the heart of the Diamondbacks lineup.

“I was disappointed leaving Detroit because that was obviously my home for so many years,” Martinez said, “but at the same time I was excited to be joining a playoff-caliber team.”

Almost immediately, he fit right into the Diamondbacks tight clubhouse.

Martinez is, Lovullo said, “a tremendous teammate and a part of this family we developed here.”

“He came here mid-season,” the manager said, “and it’s hard for players to walk into that environment. He immersed himself into this culture and he’s become one of us.”

A free agent at the end of this season, Martinez has said he’d like to stay with the Diamondbacks. But with every power surge at the plate, his value rises.

The cost of keeping him might well be too steep for a franchise that has one of the lower payrolls in baseball at under $100 million.

So if the Diamondbacks lose the wild-card game to the Rockies, it could well be Martinez’s final game in an Arizona uniform.