The end to a lawsuit filed against General Motors by a German bank in 2006 is drawing near, as the carmaker prepares to pay out $277 million as a settlement.

The payout will no doubt be felt dearly at GM, but it's equally likely that the decision to settle is financially preferable to litigating the matter, which could easily cost considerably more, especially if the company were to lose.

The suit alleges GM artificially inflated its stock price, thereby misleading investors and causing the banks to lose money by purchasing improperly valued GM stock and debt.

If the settlement is approved by the courts, it will be the 25th largest shareholder lawsuit settlement in U.S. history, reports Automotive News. Fortunately for GM, as much as $200 million of the payment will be covered by insurance. The remainder also includes a $26 million payment to be footed by Deloitte & Touche, the independent auditor of GM's financial reports. That leaves about $50 million to paid - still a hefty sum, but much more palatable than the full amount.

Once approved, half of the total amount will be paid within 30 days, per a filing the company has made with the Securities and Exchange commission (SEC). The remainder will be paid in January of 2009.