General Motors named its first female chief executive Tuesday, elevating Mary Barra, a former intern who over three decades rose to head the automaker's global product development, to its top position.

Barra, 51, joins a handful of women, including Marissa Mayer at Yahoo (YHOO) and Hewlett-Packard's (HPQ) Meg Whitman, as CEOs of major American companies. Barra will also join the GM board of directors.

She replaces Dan Akerson, who guided GM through most of the period since it emerged from bankruptcy in 2009. He will step down as chairman and CEO on Jan. 15.

Akerson announced his retirement just a day after the federal government closed the books on the taxpayer bailout of GM, selling the remaining shares in the nation's largest automaker and taking an expected $10.5-billion loss.

"I will leave with great satisfaction in what we have accomplished, great optimism over what is ahead and great pride that we are restoring General Motors as America's standard bearer in the global auto industry," Akerson said.

Akerson, 65, said he decided to advance GM's succession plan by several months after his wife was recently diagnosed with an advanced stage of cancer.

Barra joined GM 33 years ago and has held a series of manufacturing, engineering and senior staff positions.

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.

"With an amazing portfolio of cars and trucks and the strongest financial performance in our recent history, this is an exciting time at today's GM," Barra said. "I'm honored to lead the best team in the business and to keep our momentum at full speed."

Barra should prove a competent leader, said Jared Rowe, president of auto information company Kelley Blue Book.

"We've seen some of the best products released under Mary Barra, who has helped to oversee the development of their vehicles on a global scale," Rowe said.

"Now that the company has also been freed from government ownership, Mary has the opportunity to see the company continue to develop vehicles that consumers want to drive while improving its continued profitability," Rowe said.

Barra will face some challenges. She 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.

The Associated Press contributed to this report.