Swedish carmaker Saab Automobile secured a key court ruling on Wednesday allowing it to cut billions of crowns of debt and paving the way for a takeover of the General Motors unit by local sportscar maker Koenigsegg.

A court in Vanersborg, southwest Sweden, approved the 75 percent writedown of Saab's more than 10 billion crowns of debt ($1.4 billion) after creditors gave the go-ahead earlier on Wednesday.

Saab has been in bankruptcy protection since February and asked creditors to write off 75 percent of its 10.6 billion crowns ($1.36 billion) of debt, most of which is owed to GM.

The approval came after GM said on Tuesday it had struck a preliminary deal for Koenigsegg to take over the loss-making Swedish firm after two decades of U.S. ownership.

Koenigsegg was founded in 1994 by Christian von Koenigsegg. A new company called Koenigsegg Group -- with backing from other investors including Norwegian entrepreneur Bard Eker and U.S. investor Mark Bishop -- has been formed for the takeover.

The representative of the Swedish state opposed the debt writedown at the hearing, citing remaining uncertainty about the future of the carmaker, but this did not affect the outcome since a vast majority of creditors backed the

($1=7.816 Swedish crowns)

(Reporting by Johan Ahlander; Writing by Veronica Ek; Editing by Greg Mahlich)