General Motors (GM) said Thursday it completed the sale of its remaining 8.5% stake in Ally Financial, the automaker’s former lending arm, for roughly $900 million.

The company expects to record a gain of approximately $500 million, which will be treated as a special item in the fourth quarter.

A GM spokesperson said the company cannot disclose who purchased the shares.

“This transaction releases capital from a non-core asset and further enhances our financial flexibility,” said chief financial officer Dan Ammann, who added that Ally “continues to play an important role in financing our dealers and customers in the United States.”

GM had already begun reshaping its relationship with Ally, which is in the midst of legal woes tied to subprime mortgage subsidiary Residential Capital. Also, Ally has repaid more than two-thirds of its $17.2 billion bailout, but the government still owns about 64% of the company.

About a year ago, GM acquired Ally’s operations in Europe, Latin America and China for $4.2 billion. The car manufacturer then combined those operations with GM Financial, its new lending arm.

Ally, one of the nation’s largest auto lenders, said in October that it was nearing the completion of a sale process to divest a wider range of international businesses, including those sent to GM. At the time, Ally said it generated $8.3 billion in proceeds so far.

The company also announced the sale of its entire 7% stake in PSA Peugeot Citroen through a private placement to institutional investors.

GM acquired the ownership stake in the French car manufacturer when the two companies entered into a strategic alliance in March 2012. GM vice chairman Steve Girsky said the company’s alliance with PSA Peugeot Citroen will continue.

The exits from Ally and Peugeot continued a busy week for the nation’s largest automaker. On Monday, GM announced the official exit of the U.S. Treasury Department from its position in the company. The government, which has steadily reduced its ownership over the years, took a 61% stake in GM about four years ago.

A day later, GM named Mary Barra as the first female CEO in the history of Detroit’s Big Three. Barra will replace Dan Akerson, who plans to step down ahead of schedule in January.

GM also said this week that it plans to cease manufacturing in Australia by 2017. Its Holden brand will continue as a sales company, parts distribution center and design studio. Rival Ford (F) plans to exit the country by 2016.

Shares were up nine cents at $40.25 in early afternoon trading on Thursday.

Follow Matthew Rocco on Twitter @MatthewRocco