GMAC LLC, which is giving the U.S. Treasury Department a 35.4 percent equity stake, said on Friday it might take 17 years for the government to shed its investment if the auto and mortgage lender were to go public.

The timetable suggests that federal involvement in GMAC's affairs could persist long after troubles plaguing the economy and the auto industry end.

GMAC has gotten $12.5 billion of government infusions since December, including $7.5 billion on Thursday.

The Treasury Department separately said on Thursday it expects to swap a previous $884 million loan it made to General Motors Corp for the 35.4 percent stake in GMAC. It also won the right to appoint two directors to GMAC's board.

In a U.S. Securities and Exchange Commission filing, Detroit-based GMAC said that if it were to go public, the Treasury Department would begin to liquidate its stake no later than seven years after an initial public offering.

It said the government would thereafter have a goal of liquidating between 10 percent and 20 percent of the Treasury's interest in GMAC's equity securities in each succeeding year.

Thursday's $7.5 billion infusion includes $4 billion for GMAC to make loans to Chrysler LLC dealers and vehicle buyers, and $3.5 billion to bolster GMAC's capital position.

These sums are on top of $5 billion that GMAC got in December from the government's Troubled Asset Relief Program.

GMAC is the preferred lender to buyers of GM and Chrysler customers. GM and private equity firm Cerberus Capital Management LP have stakes in GMAC.

Regulators this month ordered GMAC after the conclusion of a stress test to raise $11.5 billion of capital to withstand a potentially deep economic downturn. GMAC has until June 8 to present a plan to raise the needed capital.

The two Treasury Department nominees who will join GMAC's board are Robert Blakely, a former Fannie Mae chief financial officer; and Kim Fennebresque, a former Cowen Group Inc chief executive.

GMAC said in Friday's filing that the Treasury Department would be entitled to name a majority of directors if its ownership stake were to exceed 70.8 percent.

(Reporting by Jonathan Stempel; Editing by Brian Moss)