Just a few years ago, Ford and GM were posting billions of dollars in losses and fast losing favor with American car buyers. One of them, GM eventually required a very public and controversial bailout from the government.

But both U.S. automakers have since staged comebacks — the success of which that have hinged in part on getting hip with the greener, more connected age of automobiles. That has meant offering electric and hybrid options, and turbo-charging cars’ electronics and digital offerings with fancier, more engaging in-car consoles, wireless capabilities and smartphone apps.

GM’s comeback story was perhaps  most obvious in November, when it re-emerged with a record-breaking $20 billion IPO. The new GM is a greener GM: it released in December the Chevrolet Volt, a partially-electric hybrid, which  nabbed Motor Trend’s car of the year award and was able to ramp up production quickly enough to outsell the limited-release electric Nissan Leaf in December. Chevy also announced it would donate $40 million to renewable energy projects, a strong signal that the automaker wants Chevrolet’s brand to be associated with environmental responsibility.

Ford’s comeback has been remarkable as well, with the company firstly being the only U.S. carmaker to eschew government support, then posting a $2.7 billion profit in 2009 after four years of bleeding cash. Yesterday, the company showed off the latest of its green car offerings with a debut of its all-electric car Ford Focus Electric, which VentureBeat took for a spin in September.  The hatchback is the second of five promised hybrid and electric cars Ford says it will deliver by 2013. (The Ford Transit Connect van was released last year.)

With the Focus Electric, it looks like Ford is coming out with guns blazing at its competitors. Its announcement points out that the Focus Electric has a 100-mile range, with a mile-per-gallon equivalent rating that bests the Volt. It also zings Nissan, claiming the Focus Electric charges in half the time as the Nissan Leaf — charging in three to four hours using a 240-volt home charging station.

Ford also launched the MyFord Mobile smartphone app (pictured) through which customers can monitor charging level and preheat or precool the car while it’s still plugged in, joining its electric car competition by doing so. The Focus Electric’s wireless connected vehicle services is provided by Airbiquity, the same vendor as the Nissan Leaf’s.

The car is slated to hit the market in the second half of this year, and is loaded up with features like the Ford Sync voice-activated car controls system (which is now in 3 million cars), a Microsoft-powered system that shows owners the cheapest time to charge and a GPS feature that allows drivers to map out multiple-stop trips and make sure there’s enough battery for the full trip.

Before this year, I would never have thought twice about buying an American car — I come from a family of staunch Japanese-made car enthusiasts —  but Ford’s comeback has been impressive, and the rave reviews, affordable price and great mileage of its Fiesta has had me thinking seriously about buying one.

The Focus Electric’s driving range is comparable to Nissan’s Leaf and will have a wider geographical initial release of 20 cities, compared to Nissan’s initial five-state release of the Leaf, which has closed reservations after hitting about 20,000 in orders. The Leaf has experienced production delays, however, so that could create an opening for Ford to move in and steal some sales. The company has yet to announce pricing.

Though both Ford and GM have seen their brands, revenues and reputations take a beating in recent history, I wonder whether the tide is changing back in American automakers’ favor. The next big test may well be whether or not car buyers want the Ford Focus Electric just as much as they want the Nissan Leaf.