MIAMI - The end, which arrived in the form of dugout handshakes when a pinch-hitter replaced him, was too fitting for Cole Hamels. There were more than 103 pitches in his left arm Wednesday, even on a night that was not his sharpest. But the Phillies failed to provide support, and a chance beckoned, so Hamels disappeared in a 3-2 loss to the Marlins.

This will not be remembered as his finest season. Not one bit. There is fortitude, however, in the way Hamels survived a shaky beginning and perpetual bad luck. He pitched six innings Wednesday and allowed two runs against last-place Miami.

Related stories

The Phillies have scored 18 runs in their last seven games, six of which are losses. This is far from what Hamels intended when he signed a six-year, $144 million contract to play October baseball in Philadelphia. For Hamels, there is a moral.

"Understanding what you can control and what you can't control," Hamels said, "that is ultimately the big learning lesson this season."

Hamels finished with a 3.60 ERA, his highest mark since his charmless 2009 season. He threw 220 innings, a number eclipsed only in 2008, and walked two fewer batters in six more total innings than last season.

Troglodytes will point to his 8-14 record as an indicator of failure. But Hamels, 29, lost games he deserved to win because of poor run support or a leaky bullpen. He permitted 13 runs in his first two starts this season and pitched to a 3.22 ERA in the next 31 starts.

"He expects to go out and pitch a good game," manager Ryne Sandberg said. "I've noticed that all year. Even the way things have gone. Any frustration he could have had this year, he takes it out on the baseball that he has in his hand and delivering the pitch to home plate. He takes it out on the opposing hitter. He doesn't look for any excuses."

There was a point when Hamels' frustration boiled. Pitching coach Rich Dubee delayed Hamels' first start in July by two days so the pitcher could "kick back a little bit." At first, Hamels resisted the mental break. Now, with hindsight, he has accepted it.

"I understood the consequences," Hamels said. "I understood what they were doing. I just wasn't staying within myself. I was getting a little carried away with certain things you shouldn't allow yourself to be affected by."

Hamels was victimized Wednesday in the second inning. Adeiny Hechavarria smashed a middle-in, 0-2 fastball to the deepest part of this cavernous ballpark for a two-run triple.

This game turned bizarre when Hamels departed. Cesar Jimenez relieved him and picked off Juan Pierre at second base in the seventh. But umpire Dale Scott blew the call. Then, Christian Yelich tapped one to first base. Kevin Frandsen flipped it to Jimenez, who waved at Yelich with his bare hand. C.B. Bucknor, enjoying his daydream, called Yelich out.

The Marlins attacked Ethan Martin for the decisive run, scored on an infield chopper by Hechavarria, in the eighth inning. Hamels watched it all from the dugout, one day closer to a clean slate.

"It sucks," he said. "From tomorrow when I start my offseason program, that's what the goal is, to get to October and win. It's two years in a row. The whole offseason we're training; I don't take a day off because I feel like it will help me better and help make the team better so we can go to October. It's unfortunate."

Split Season

Cole Hamels' performance in the first year of his six-year, $144 million contract extension:

Through May 31

1-9, 4.86 ERA

Since June 1

7-5, 2.96 ERA