GM said Tuesday that Barra, 51, will replace Dan Akerson on Jan. 15. Akerson, 65, chairman and CEO, moved up his retirement plans by several months because his wife, Karin, is battling an advanced form of cancer.
''I need to spend all my time and energy in fighting this disease with my wife,'' Akerson said on a conference call with reporters. Akerson had originally planned to stay into the spring or summer.
Since February 2011 Barra has held what many say is the most important job at GM - senior vice president for global product development. Barra, who joined GM in 1980, is currently in charge of design, engineering and quality for all of GM's vehicles across the globe and has shepherded most of the company's recent new vehicle introductions.
Under her command, GM rolled out brawny new full-size pickup trucks, the Chevrolet Silverado and GMC Sierra, and the Chevrolet Impala full-size car, which earned the highest score for a sedan in testing by Consumer Reports magazine. Its quality scores also rose in surveys conducted by J.D. Power and Associates. She also led development of the new Chevrolet Corvette and several new Cadillac models.
Akerson took over GM in September 2010, as the company prepared to go public about a year after emerging from bankruptcy protection. During his tenure GM has made billions of dollars in profits and is sitting on $26.8 billion in cash. Its profit margins in North America are a healthy 9 percent. He and Barra have revamped GM's lineup of cars and trucks.
On Monday, GM officially shed the derisive moniker of ''Government Motors'' when the government sold the last of the GM shares it inherited as part of a bailout in 2008 and 2009.
But Barra still needs to trim GM's costs and win over buyers in markets such as India and South America. One big step in getting there: producing more vehicles that can be sold in multiple markets, such as the Chevrolet Cruze compact car.
The choice of Barra was unanimous, Akerson said, because of her breadth of experience, management and people skills and her understanding of GM's operations. The GM board considered only internal candidates.
''This is an executive who has a vision of where she wants to take the organization,'' he said, adding that Barra took over product development when it was in chaos not long after GM emerged from bankruptcy protection.
Akerson hinted at the move earlier this year when he told a women's business group in Detroit that a ''car gal'' would run one of the Detroit Three automakers someday soon.
But Akerson made it clear Tuesday that Barra was picked for her background and accomplishments, not because of her gender.
''Mary's one of the most gifted executives I've met in my career,'' he said. ''She was picked for her talent, not for her gender, not for political correctness.''
Barra, who grew up near Pontiac, Michigan, is the daughter of a die maker who retired from GM after 39 years. GM's previous two CEOs, Akerson and Ed Whitacre, came from the telecommunications and finance industries and lacked the auto industry experience that Barra has, said Erik Gordon, a professor at the University of Michigan's Ross School of Business.
''There's nobody with more years of honest `car-guy' credentials than she has,'' Gordon said. ''She's the one to do the breakthrough,'' Gordon said.
Women have held top positions in auto marketing design and engineering, but never made it to the CEO spot, Gordon said. ''The fact that none of them has run a major car company makes no sense,'' he said.
The GM board decided to separate the positions of chairman and CEO. Barra will get a board seat, but director Theodore (Tim) Solso will succeed Akerson as chairman. Solso, a GM board member since June 2012, is the former chairman and CEO of engine maker Cummins Inc.
Barra started with GM as an electrical engineering co-op student when she attended what is now Kettering University in nearby Flint. She previously ran GM's human resources operations. Before that she was a plant manager and executive director of engineering. She holds a master's degree in business administration from Stanford University.
Barra was among four internal candidates for the position, including Chief Financial Officer Dan Ammann, North American President Mark Reuss and Vice Chairman Steve Girsky.
Ammann, 41, was named GM president and will manage its regional operations worldwide.
Reuss, 50, replaces Barra as head of product development and purchasing. Girsky, 51, will become a senior adviser until he leaves the company in April. He'll stay on the board.
Reuss will be replaced by Alan Batey, 50, as North American president.
The change at the top comes a day after the U.S. government sold the last of its stake in GM. The government got 912 million GM shares in exchange for a $49.5 billion bailout. The government ended up getting $39 billion of its money back, leaving taxpayers short by $10.5 billion.
Detroit's auto industry power structure faces a year of change at the top. Ford CEO Alan Mulally is in the running to lead Microsoft Corp. and could leave before his planned departure sometime after the end of 2014.
Shares of GM fell 30 cents, or 0.7 percent, to $40.60.