Tiny Dutch sportscar maker Spyker clinched a last-minute deal on Tuesday to buy Sweden's Saab, in an audacious attempt to turn around a money-losing brand that only days ago was headed for oblivion.

Saab owner General Motors announced the deal, without disclosing financial details, but a source familiar with the matter said Spyker would buy Saab for $400 million, $74 million of which is in cash, with the rest in deferred shares.

Saab is seeking to borrow 400 million euros ($564 million) from the European Investment Bank, a loan that Sweden announced on Tuesday it would guarantee. Sweden said the EIB and European Commission were still reviewing the loan.

The Swedish carmaker -- which has a devoted following among auto enthusiasts taken with its distinctive, quirky style -- has failed to make money for much of the past two decades as GM was unable to find a global audience for the cars.

But GM grew wary of selling Saab and its new designs for fear of giving a potential rival a technological edge.

General Motors, Spyker Cars, and the Swedish government worked very hard and creatively for a deal that would secure a sustainable future for this unique and iconic brand, GM Vice President John Smith said in a statement.

Despite years of hemorrhaging money, the 60-year-old Swedish group has many fans, some of whom believe it could be profitable with the right owner.

It's a really brilliant brand. It's probably one of the biggest brand mismanagement stories in the history of the automotive industry, said Tim Urquhart, analyst at IHS Global Insight.

Saab could have been the Swedish Audi if it had been taken on in the right way 20 years ago. It's been completely mismanaged, underinvested in by people who don't understand what the brand means, and what it has the potential to mean.

Whether the right owner is Spyker is open to question, analysts say.

Spyker, which only produces several dozen handmade sports cars a year, hopes to benefit from Saab's technical resources and distribution network. Saab will get funds to survive and an injection of entrepreneurial spirit.

The market sensed a deal was in the offing on Monday, bidding up Spyker shares as much as 80 percent before they eased on Tuesday and then were halted in Amsterdam trading.

DAVID & GOLIATH

Like Swedish firm Koenigsegg, another tiny sports car maker which had struck a deal to buy Saab, Spyker's purchase represents a David-and-Goliath story.

While Spyker employs about 100 people, Saab has some 3,400. While Spyker made 43 luxury cars last year, Saab's annual sales exceed 90,000.

Even at this week's inflated prices, Spyker's market value is less than $85 million.

One thing the two firms have in common is an inability to make money, which has made analysts skeptical of the plan. Since the Dutch firm was resurrected as a brand in 2000, it has not made a profit.

Koenigsegg, which builds a handful of hand-made cars a year which sell for $1 million, withdrew its own bid last November after months of delays in closing a deal.

The incentive to ditch Saab has long been clear as GM sought to address its own pressing financial problems. But the U.S. group was concerned about selling technology it has shared with Saab and which powers many of its own models.

GM had already sold old Saab technology and design systems to Chinese group BAIC, but Spyker was eager to gets its hands on the know-how behind Saab's recently debuted 9-5 car series.

After the Koenigsegg deal collapsed, several companies scrambled to try and pick up Saab. Spyker emerged as the sole bidder after investment company Genii Capital, backed by Formula One mogul Bernie Ecclestone, withdrew an offer on Monday.

GM was on the verge of winding Saab down, a move that would not only have killed the brand but also would have devastated the southern Swedish town of Trollhattan, where Saab is based.

Spyker Chief Executive Victor Muller, a 50-year-old former fashion executive, traveled to Stockholm to hold exhaustive negotiations on what he called a complicated, extremely technical deal.

His eventual journey to the Swedish capital started when he revamped the former family firm a decade ago, a company that once built a coach for the Dutch royal family but was liquidated in 1926.

(Writing by Adam Cox; additional reporting by Jui Chakrovorty in New York, Reed Stevenson in Amsterdam, Helen Massy Beresford in Paris, and Oskar von Bahr, Mia Shanley and Niklas Pollard in Stockholm; editing by Will Waterman)

($1=.7097 Euro)