Selig turned 80 last month and has ruled baseball since September 1992, when he was among the owners who forced Commissioner Fay Vincent's resignation. He said he intends to retire in January.
Manfred fell one vote shy of the 23 out of 30 owners needed in the first ballot earlier Thursday. On the second ballot, he won unanimously, several owners confirmed.
Each candidate spoke to owners for about an hour Wednesday and met in sessions Thursday morning with groups of 10 teams.
Werner was supported by Chicago White Sox owner Jerry Reinsdorf and Los Angeles Angels owner Arte Moreno. Other teams have said Reinsdorf wanted a commissioner who would take a harsher stance in labor negotiations.
Selig is the second-longest-serving head of baseball behind Kenesaw Mountain Landis (1920-44). The trio of candidates was picked by a seven-man succession committee chaired by St. Louis Cardinals chairman Bill DeWitt Jr.
Manfred has been involved in baseball since 1987, starting as a lawyer with Morgan, Lewis & Bockius who assisted in collective bargaining. He became MLB's executive vice president for labor relations and human resources in 1998, received an expanded role of executive vice president of economics and league affairs in 2012 and last September was promoted to chief operating officer. He helped lead negotiations for baseball's last three labor contracts with players and the joint drug agreement that was instituted in 2002 and has been repeatedly strengthened.
Werner, 64, was the controlling owner of the San Diego Padres from 1990-94, triggering fan criticism for the payroll-paring departures of Fred McGriff, Gary Sheffield, Tony Fernandez, Randy Myers and Benito Santiago. He has been part of the Red Sox ownership group since 2002, a period that included three World Series titles. While working at ABC, he helped develop Robin Williams' "Mork & Mindy" and later was executive producer of "The Cosby Show" and "Roseanne" at The Carsey-Werner Co.