View Photo Gallery: “I was trying to hit him,” said Cole Hamels after he plunked Bryce Harper in the first inning of a game back on May 6th. Hamels will be in Philadelphia for six more years after signing an extension.

Cole Hamels has agreed to a six-year contract extension with the Philadelphia Phillies that will make him the second-highest paid pitcher in baseball history.

At $144 million, the deal is the richest in Phillies’ history. The Yankees’ CC Sabathia is the highest-paid pitcher at $161 million over seven years.

Hamels, 28, has an 11-4 record with a a 3.23 ERA and 131 strikeouts in 133 2/3 innings this season. His next start will be his 200th with the Phillies and, over seven years with the team, the 2008 World Series MVP is 85-58 with a 3.38 ERA.

The Phillies broke the bank to keep Hamels off the free-agent market. ESPN’s Buster Olney estimates that Hamels’s value has gone up 70-75 percent since spring training. Hamels had turned down an $80-million offer from the Phillies late last season.

The team made its latest offer to Hamels after his start Saturday and, as late as Tuesday night, a source told the Philadelphia Inquirer “still issues” remaining. Those quickly were resolved after the Phillies’ 7-6 victory over Milwaukee.

Among other things, the extension guarantees there’ll be more matchups between Hamels and Bryce Harper of the Washington Nationals and adds peat to the Nats-Phillies rivalry. In May, Hamels was suspended for five games after he admitted to plunking Harper with a pitch, in a move that prompted Nats GM Mike Rizzo to use words like “classless, gutless” and “fake tough.”

Follow us: @CindyBoren | @MattBrooksWP