Alex Cora, who guided the Boston Red Sox to victory in the 2018 World Series, agreed to a three-year contract extension to remain as manager of the Major League Baseball club.

The Red Sox announced on Wednesday they had reached a deal keeping the 48-year-old Puerto Rican bench boss in his job through 2027.

Cora is 494-417 in six seasons as manager of the Red Sox, his title run coming in his first season at Boston.

The Red Sox lost to Houston in the 2021 American League Championship Series but have missed the playoffs the past two seasons.

This year they are 54-47, third in the AL East division and just behind Kansas City for the last AL playoff berth.

“I’m excited about not only where we are as an organization, but also where we’re going,” Cora said.

The deal, according to ESPN, will make Cora the second-highest-paid manager in MLB at $21.75 million.

“He has embraced Boston’s passionate fans and we share a desire to win as much as they do, both in 2024 and in the future,” Red Sox chief baseball officer Craig Breslow said in a statement.

“I’m happy to be able to extend our commitment to Alex and I look forward to our partnership continuing to grow.”