BALTIMORE — Rob Manfred was elected baseball’s 10th commissioner Thursday, winning a three-man race to succeed Bud Selig and given a mandate by the tradition-bound sport to recapture young fans and speed play in an era that has seen competition increase and attention spans shrink.

The 55-year-old Manfred, who has worked for Major League Baseball in roles with ever-increasing authority since 1998, will take over from the 80-year-old Selig on Jan. 25. It’s a generational change much like the NBA undertook when Adam Silver, then 51, replaced 71-year-old David Stern as commissioner in February. And like Silver, Manfred was his boss’s pick.

Manfred beat out Boston Red Sox Chairman Tom Werner in the first contested vote for a new commissioner in 46 years. The third candidate, MLB Executive Vice President of Business Tim Brosnan, withdrew just before the start of balloting.

“I am tremendously honored by the confidence that the owners showed in me today,” Manfred said. “I have very big shoes to fill.”

Selig has led baseball since September 1992, first as chairman of the sport’s executive council following Fay Vincent’s forced resignation and as commissioner since July 1998. After announcing his intention to retire many times only to change his mind, he said last September that he really, truly planned to depart in January 2015.

One baseball executive who attended the meeting, speaking on condition of anonymity because details of the 4 1/2-hour session were not to be divulged, said Manfred was elected on approximately the sixth ballot. The initial vote was 20-10 for Manfred, three short of the required three-quarters majority.

His total increased to 21 on the second and 22 on the third. While teams put written ballots into envelopes, keeping their choices secret, from team official speeches it was evident that Tampa Bay’s Stuart Sternberg and Milwaukee’s Mark Attanasio likely switched, the person said.

Manfred’s total dropped to 20, then increased back to 22 before a dinner break. He got the needed 23rd vote on the next, apparently from Washington. Owners then made the final vote unanimous. The person said it appeared Arizona, Boston, the Chicago White Sox, Cincinnati, the Los Angeles Angels, Oakland and Toronto had been the final holdouts.

“What I said to the owners when I came down after the vote is that I didn’t really want to even think about who was on what side of what issue at points in the process,” Manfred said, “and that my commitment to the owners was that I would work extremely hard day in and day out to convince all 30 of them that they had made a great decision today.”

“While Rob may not have been my initial choice for commissioner, the conclusion of a very good process was to name Rob as the person best positioned to help baseball endure and grow even stronger for the next generation of fans,” Reinsdorf said in a statement. “Today’s decision was reached by 30 owners voting separately but speaking, in the end, with one voice.”

Werner, who made his career as a television executive, was preferred by those who wanted an owner to follow Selig, who was the longtime head of the Milwaukee Brewers when he took over MLB.

“I think the last two days have been productive because we’ve been able to share a number of ideas about the game and how to improve it and modernize it,” Werner said. “I think that Rob agrees with many of the ideas that I espoused, and I am very confident that we are going to see some things, such as improved pace of play.”

Brosnan quit the race when it became apparent he likely had one vote: Cincinnati.

“I cared too much about the game and really wanted the process to be as efficient as it could be,” he said.

Manfred started with baseball in the late 1980s as an outside counsel in labor negotiations and was hired by Selig as executive vice president for labor relations and human resources in 1998. He received an expanded role of executive vice president of economics and league affairs in 2012 and last September was promoted to chief operating officer, becoming the likely heir apparent to Selig.

Manfred helped lead negotiations for baseball’s last three labor contracts and the first joint drug agreement that was instituted in 2002, a program that has been strengthened repeatedly.

“There is no doubt in my mind he has the training, the temperament, the experience to be a very successful commissioner,” Selig said, “and I have justifiably very high expectations.”

In the last contested election, in 1968-69, owners turned to their outside labor lawyer, Bowie Kuhn.

Manfred, whose term was not specified, grew up in Rome, New York — about an hour’s drive from the Hall of Fame in Cooperstown. He must address issues that include decreased interest in baseball among young people and an average game time that has stretched to 3:03 — up 30 minutes from 1981. And he will be leading an opinionated group of multimillionaires and billionaires.

“I think some of Rob’s greatest attributes are his ability to reach consensus,” said St. Louis owner Bill DeWitt Jr., who chaired the committee that picked the three candidates.

Baseball has had labor peace since a 7 1/2-month strike in 1994-95 that canceled the World Series. Talks to replace the collective bargaining agreement with players that expires after the 2016 season will be conducted with a new union leadership headed by former All-Star first baseman Tony Clark.

“I have known Rob for more than 15 years, and I’m confident that his vast experience in all aspects of the sport will serve his commissionership well,” Clark said in a statement.

While average attendance of about 30,500 is not far below the record of 32,785 set in 2007 before the Great Recession, national television ratings for the World Series have dropped by more than 50 percent under Selig — partly because of fractured viewing caused by the vast increase in available networks.

“We have to figure out ways to make it relevant to that 12-year-old,” San Francisco Giants President Larry Baer said. “I have four children, and we want to make baseball as relevant as possible to them with their handheld and on television and getting more people playing the sport. Those are all big challenges, and I think Rob sees all of those in his purview, and I think he’s ready to attack.”