NEW YORK -- It happened so fast, Eric Bruntlett needed a few moments before he realized he had just ended a game with an unassisted triple play.

Bruntlett became the second player in major league history to get the final three outs on his own, accomplishing the feat Sunday to preserve the Philadelphia Phillies' 9-7 victory over the New York Mets.

"I didn't know how to react. I didn't know what to do," Bruntlett said. "The ninth inning was wild. The whole game it seemed was strange."

Indeed, it was a stunning end to a crazy game that included an inside-the-park homer after the ball got stuck under the outfield wall.

Bruntlett turned the 15th unassisted triple play in big league history -- the second that ended a game. Detroit Tigers first baseman Johnny Neun also turned the trick on May 31, 1927, completing a 1-0 victory over Cleveland, according to STATS LLC.

The amazing final sequence made a winner of Pedro Martinez in his return to New York and quashed a Mets rally against closer Brad Lidge.

"We picked a good time," Phillies manager Charlie Manuel said.

With runners on first and second in the ninth inning and a run already in, Jeff Francoeur hit a line drive up the middle that appeared headed toward center field for a single. But both runners were stealing on the 2-2 pitch, so Bruntlett was in perfect position as he moved over to cover second base.

He caught the liner easily, stepped on second to double up Luis Castillo and then turned to tag Daniel Murphy for the third out. Murphy tried to backpedal away from Bruntlett, but had nowhere to go.

"Frenchy hit it on the screws," Murphy said. "It happened so fast there was nothing I could do."

After bolting out of the box, a frustrated Francoeur stopped in his tracks and threw down his helmet with both hands.

"What a bizarre ending. I don't know what happened there. The game's over, so I'm happy with that," Lidge said. "That was pretty exciting. That's definitely not the way you draw it up."

The Phillies raced onto the field to congratulate Bruntlett after his rare play secured Lidge's 25th save in 33 chances.

It was the first unassisted triple play since Cleveland second baseman Asdrubal Cabrera turned one in the fifth inning on May 12, 2008, against Toronto.

Bruntlett, who made one of two Phillies errors earlier in the inning, started at second because All-Star Chase Utley was rested.

Another Phillies second baseman, Mickey Morandini, turned an unassisted triple play in 1992.

It was the first time the Mets were involved in such a play.

"Even with the runners going I did not expect him to be there. The only place he could catch the ball was where he was," Francoeur said. "To end the way it did was a little disheartening."

Angel Pagan hit the inside-the-park shot and added another homer for the Mets, handed yet another befuddling defeat. New York has found improbable ways to lose all year: Murphy dropped a fly ball in left field, Ryan Church missed third base while rounding the bag, Castillo flubbed Alex Rodriguez's ninth-inning popup at Yankee Stadium.

Of the 15 unassisted triple plays in big league history, all but one came during the regular season. Cleveland second baseman Bill Wambsganss accomplished the feat in the 1920 World Series against Brooklyn.

Martinez batted before throwing a pitch. The Phillies scored six times in the first inning off Oliver Perez on three-run homers by Jayson Werth and Carlos Ruiz.

The Citi Field crowd of 39,038 stood and cheered as Martinez walked to the plate in the Phillies' road gray-and-red uniform, a jarring sight for sure after he spent the previous four years with the Mets.

"The ovation, that's exactly the response I expected because of the mutual bond I have here," Martinez said. "I respect them and I love them."

Martinez worked the count to 3-0 and Mets manager Jerry Manuel came out to remove Perez, bothered recently by a tender right knee that sidelined him earlier this season. The move got a loud ovation, and Perez (3-4) was soundly booed as he walked off the field having thrown 47 pitches -- 20 strikes -- and getting just two outs.

Nelson Figueroa struck out Martinez to end the 26-minute inning.

The 37-year-old Martinez then gave up Pagan's inside-the-park homer leading off the first.

Pagan's drive to left-center briefly got stuck under the padding of the wall. Center fielder Shane Victorino threw his hands up, looking for a ground-rule double, as Pagan slowed into third, but second base umpire Rob Drake allowed play to go on and Pagan raced home for his first career inside-the-park homer.

Charlie Manuel said the issue wasn't covered when the umpires went over ground rules before the game.

"They never talked about that," he said.

Martinez (2-0) never lived up to the $53 million contract he signed with the Mets after 2004, winning just 32 games and missing the 2006 playoffs with one of many injuries, including major shoulder surgery that limited him to just five starts in '07 -- all during the September collapse.

The wiry three-time Cy Young Award winner was not offered a contract after going 5-6 with a 5.61 ERA in 20 starts for the Mets last year -- a trying season in which his father died.

He labored through six innings -- and hit an RBI single -- while giving up four runs and seven hits in his third start with the Phillies after signing with them as a free agent on July 15.

Game notes

Pagan's inside-the-park homer was the 25th in Mets history, and second leading off a game. Charlie Neal hit the other one in 1963 at the Polo Grounds against Philadelphia. ... Charlie Manuel was ejected in the ninth after umpires reversed a call. ... Francoeur bruised his left thumb while making a diving catch. X-rays were negative.