SAN FRANCISCO — For years, General Motors couldn't build a good small car. Now, it shows it can with the '12 Chevrolet Sonic.

What took so long for GM, and Chevy in particular, to come up with something worthy after producing small cars such as the awful Vega, mediocre Cavalier and so-so Cobalt?

The auto maker looked at life anew after coming close to meeting its maker in the dark years of 2008 and 2009, a former staffer tells WardsAuto. “Having been through a near-death experience, GM hopefully has learned what it takes to build a world-class small car, or any such car for that matter.”

The Sonic shows a lot of soul with fresh styling, agile driving dynamics and a spirited turbocharged engine option. On the sensible side, it features 10 airbags, fuel economy of up to 40 mpg (5.9 L/100 km) and a competitive $14,995 base price.

At one time, that amount would buy a cheap econobox from GM. But it buys a lot of value in the all-new Sonic.

“The Sonic blends the practicality of a small car with the passion for driving that Chevrolet vehicles like the Corvette are known for,” says Chris Perry, the brand's marketing vice president.

Corvette comparisons may stretch things, but the point is taken. GM was determined to make a commendable compact, rather than follow the old flawed business plan of cutting corners at every turn of product development.

“We set out to outclass the class,” says Margaret Brooks, Chevrolet's director-product marketing. The goal was to develop a “fun” small car with personality, refined driving manners and connectivity.

The Sonic replaces the Chevy Aveo, a Korean-made pint-sized car that had little going for it except a low $12,000 sticker. With the Sonic, “think everything you knew about the Aveo, and put it aside,” Brooks says.

GM's design center in Korea created the exterior and interior look for the two Sonic models, a 4-door sedan and 5-door hatchback.

GM Design Manager Kathy Sirvio oversaw a team of young stylists. They went for an edgy appearance, including a wide stance for a sense of presence and a sharply slanted windshield as an expression of aerodynamics.

A motorcycle enthusiast, Sirvio says her crew used motorcycle-design cues in creating elements such as exposed round headlights without traditional lens covers and an asymmetrical instrument-panel cluster with a large digital speedometer.

The Sonic comes with two inline 4-cyl. engine choices.

The base engine is an Ecotec 1.8L. Optional is a 1.4L turbo with the same 138 hp but a faster tip-in from higher torque, 148 lbs.-ft. (200 Nm) at 2,500 rpm.

Both engines are used in the Chevrolet Cruze, a hot seller in the upper-small segment, with about 900,000 worldwide deliveries since its introduction in late 2009.

The Sonic, built in Lake Orion, MI, becomes the only U.S.-made car in its segment, a potential selling point. GM's last home-made entry-level small car was the Chevy Chevette, which had a few good sales years but is mostly remembered as a lousy car.

“The Sonic is designed globally but fine-tuned to American tastes,” Brooks says.

It goes up against some tough competitors in the lower small-car category, including the Honda Fit, Ford Fiesta, Hyundai Accent and segment-leader Nissan Versa.

The Sonic is the first GM offering on an all-new global architecture, notes Joaquin Nuno-Whelan, the vehicle's chief engineer.

“We wanted to take advantage of a new architecture but then do it right, from the very beginning,” he says. “If you plan going in to be best in class, you don't do stupid things and then take corrective steps later.”

GM plans to pitch the Sonic to so-called Millennials, age 18 to 30, “customers we haven't played to before,” Brooks says.

They are 80 million strong with annual purchasing power of $200 billion and a new set of expectations as consumers, says John McFarland, GM's senior manager-global strategic marketing.

“Some people ask, ‘Aren't they just the new young generation?’” he says. “No, they're not the same.”

They are discriminating, Internet-oriented, value-conscious and not likely to spend hours at a dealership during a protracted sales process.

“Today's customers bring a new level of expectations,” Brooks says.

GM plans a series of training sessions with dealership personnel nationwide to teach them how best to deal with Millennials, she says. “We know that is where we have work to do.”

A 35-day training tour in major cities will “immerse” sales people in half-day sessions that cover both the product and insights into young consumers, Brooks tells WardsAuto.

GM also is working with its finance affiliates on how to assist Millennials who show credit-worthy promise but lack credit histories.

“It starts with our dealers,” McFarland says. “If we develop an amazing product, but we haven't equipped dealers to connect with this young customer, we are not doing our job.”

The Sonic is the right car for the times, says that former GM staffer. “It's attractive and well-equipped. The problem will be convincing buyers, who have been burned in the past by Cavaliers, Cobalts, Metros, Prizms and Spectrums, that Chevrolet can build a good small car.”

Yet, word travels fast when a new vehicle has what it takes; consider the success of the Cruze. GM is hoping for a similar sales boom with the Sonic.