BOSTON – The Boston Red Sox didn’t pick up any new impact players at the trading deadline. Instead they showed some signs of life thanks to one of their old stars.

David Ortiz brought back memories of the team’s World Series runs with his first game-ending hit in almost a year, doubling in three runs with one out in the ninth inning Saturday to lead the Red Sox to a 5-4 victory against the Detroit Tigers.

It was the 18th regular-season walkoff hit of his career, but his first since last Aug. 26.

“The guy’s been doing it for a long time and he got us,” said Tigers Manager Jim Leyland, who walked Kevin Youkilis to load the bases and create a left-lefty matchup with Phil Coke. “You’re hoping you get a strikeout or a double play there, but he got us.”

Ortiz had stranded six baserunners, striking out with two runners in scoring position in the sixth and with the bases loaded in the seventh, when he came up against Coke in the ninth. Ortiz was 0 for 8 with three strikeouts against Coke in his career.

“I was having a crazy day today,” Ortiz said. “I faced a few situations and I didn’t come through.”

But he did when it was most important.

“I won,” he said. “That’s it. Game over.”

Ortiz showed a bunt against the shifted defense on the first pitch, then took another pitch for Ball 2. After fouling one off, he lined the next pitch into the left-center gap as the runners raced around the bases.

Darnell McDonald and Jed Lowrie scored before Youkilis slid across the plate without a throw.

Ortiz celebrated at second base, and his teammates soon joined him there.

“It felt good, man,” Ortiz said. “It was a game that we weren’t able to score some runs in the few opportunities that we had. To come back and win it felt great.”

Hideki Okajima (4-3) pitched a perfect ninth inning.

Coke (6-2) took the loss after coming in with one on in the ninth. The only batter he retired was Marco Scutaro, who hit a long fly ball that left fielder Don Kelly jumped to grab in the top of the webbing of his glove.

The Red Sox trailed 2-0 on Miguel Cabrera’s 26th homer in the first inning and fell behind 4-0 after four.

Ortiz got another chance in the ninth when McDonald beat out an infield single to lead off the inning, and Coke came in to relieve Ryan Perry. Scutaro’s drive was more of a warning shot: Pinch-hitter Lowrie doubled to the same part of the field, and then Youkilis was walked to load the bases.

Ortiz, McDonald and Billy Hall each had a pair of hits for Boston, and Ryan Kalish also had two hits in his major league debut. The Red Sox, who failed to make a big trade by the 4 p.m. deadline, won for just the 10th time in 24 games since improving to a half-game behind the first-place New York Yankees on July 3.

“It was a busy day, a long day and it ended up being a good one,” Red Sox Manager Terry Francona said.

“Anytime you hear the music playing at the end, it’s a good one.”

Max Scherzer took a shutout into the seventh inning, leaving with a 4-0 lead.