General Motors Co plans to buy auto finance company AmeriCredit Corp for $3.5 billion in a cash deal financed by government bailout money and aimed at removing a major investor concern before a planned IPO.

The deal announced Thursday would give GM an in-house lending arm for the first time since it sold a controlling stake in GMAC in 2006 and a chance to compete with faster-growing rivals led by Ford Motor Co , by offering riskier forms of financing including subprime loans and leases.

The move also represents an admission that the go-it-alone strategy of past GM management had failed and a bet that the government-owned automaker can improve returns for taxpayers by drawing down part of the cash cushion left from its bailout.

Many GM dealers have complained that lack of financing options for consumers has cost them sales in a U.S. auto market stuck in a slow grinding recovery.

Analysts said the AmeriCredit deal addresses a risk to GM's sales momentum as it prepares for a stock offering this year that is intended to lower the government's nearly 61 percent stake.

But by bringing financing back in-house, GM is also taking on risk by stepping back into an area that forced the automaker to take massive charges as recently as 2008.

It is going to be much more beneficial for GM to have a captive finance arm when they go to do their IPO. Without it, it puts them at a disadvantage, said Autoconomy.com analyst Erich Merkle.

Mike Jackson, chief executive of the No. 1 U.S. auto dealership group AutoNation , said the AmeriCredit deal shows that GM is executing on its turnaround plan.

I have said it to anyone and everyone who would listen, Jackson told Reuters. I wouldn't run an auto manufacturer without a captive finance company. I think it's that strategically crucial.

GM plans to pay AmeriCredit stockholders $24.50 per share. AmeriCredit closed up 21 percent at $23.91 on Thursday.

'CORE' OF A NEW FINANCE ARM

AmeriCredit, which has $9 billion in auto loans, would become the core of a new GM finance arm.

Other major automakers, including Ford Motor Co and Toyota Motor Corp <7203.T>, have in-house financing arms they use to provide loans to dealers and car buyers, often at subsidized rates to help sell vehicles.

GM's move leaves Chrysler, controlled by Fiat SpA, as the only large automaker without a dedicated financing arm.

GM Chief Executive Ed Whitacre said the automaker recognized it could not compete without owning its own lending arm. That reverses a stance that dates to 2006 when it was scrambling to raise cash under former CEO Rick Wagoner and sold control of GMAC.

We were not as competitive as we could be, and it hurt our ability to meet rising demand for GM cars and trucks, Whitacre said. Now we are going to fix that.

GM ended the first quarter with $36 billion in cash and securities. It will pay for AmeriCredit from that cash, funding left over from the Obama administration's $50 billion bailout.

U.S. officials have said they would not interfere with decisions by GM. A spokesman for the U.S. Treasury said the department had been notified in advance of the deal but played no role in it.

GM management moved to close the AmeriCredit deal quickly when it was presented, Whitacre said. GM expects the deal to close in the fourth quarter.

An earlier plan GM officials had considered would have seen the automaker take back the auto financing operations of GMAC, essentially combining parts of two government-owned firms.

Detroit-based GMAC, now known as Ally Financial , is 56-percent owned by the U.S. Treasury after the government injected $17 billion as part of a restructuring that also saw the finance company become a commercial bank.

'BUILDING BLOCK' TO IPO

GM Chief Financial Officer Chris Liddell said the deal would help GM repay its taxpayer investment by providing a building block toward a more successful IPO.

With Fort Worth, Texas-based AmeriCredit operating as part of GM, the automaker expects to offer more loans to subprime buyers and to sell more vehicles on lease.

GM's sales to subprime customers could rise to 5 percent or 6 percent of sales from 4 percent now, Liddell said.

GM's lease rates as a share of sales will also rise from 7 percent closer to the 21 percent that the rest of the industry averages, he said.

The goal is to lift GM's U.S. sales which trailed the industry in the first half. GM had 14 percent growth while U.S. sales jumped 17 percent.

Jesse Toprak, an analyst with market tracking firm TrueCar, estimates that about 25 million U.S. car shoppers have been pushed into the subprime credit category because of difficulties in restructuring their mortgages.

Most of those consumers could afford monthly auto payments if they could find financing at dealerships and those loans would be less risky than simple credit scores would suggest.

I think this is a smart move by GM and if they get this right, they can see sales rise significantly, said Toprak.

A subprime borrower is generally defined as a customer with a credit score below 620. Such borrowers can account for up to 25 percent of car shoppers in some markets, dealers say.

(Reporting by Kevin Krolicki and David Bailey in Detroit, David Lawder in Washington; Editing by Robert MacMillan, Leslie Gevirtz and Tim Dobbyn)