The Boston Red Sox said Monday that they will retire Pedro Martinez’s number on July 28, two days after he is inducted into the Baseball Hall of Fame.

Martinez, one of baseball’s best pitchers of the late 1990s and early 2000s, was elected to the Hall of Fame this year. He will be inducted on July 26 in Cooperstown, N.Y., then go to Boston for the ceremony to retire his number, 45.

Martinez will be the ninth player to have his number retired by the Red Sox, joining Bobby Doerr’s No. 1, Joe Cronin’s No. 4, Johnny Pesky’s No. 6, Carl Yastrzemski’s No. 8, Ted Williams’ No. 9, Jim Rice’s No. 14, Carlton Fisk’s No. 27 and Jackie Robinson’s No. 42, which is retired throughout Major League Baseball.

“To be elected into the Baseball Hall of Fame upon his first year of eligibility speaks volumes regarding Pedro’s outstanding career, and is a testament to the respect and admiration so many in baseball have for him,” said Red Sox principal owner John Henry in a prepared statement Monday.

Martinez won three Cy Young Awards in his career as was an All-Star eight times. He played for the Red Sox for seven seasons, ending in 2004, when Boston won its first World Series in 86 years.

Martinez went 117-37 with a 2.52 ERA with Boston. He holds franchise records in strikeouts per nine innings (11.0) and opponent batting average (.206), and has the best winning percentage in franchise history.

Martinez, now 43, has spent the past 2½ years serving as a special assistant to general manager Ben Cherington.