General Motors reported the best profit margin in its 107-year history in 2015, just six years after the company was saved by a federal bailout.

The nation's largest automaker benefited from strong car sales in both the United States and China, where it now sells more cars than it does at home.

Total global sales came to 9.8 million cars and trucks, the third straight year GM set a record for the company. It also benefited from a more competitive labor deal than it had before the bankruptcy.

The result is further proof that the company has also put the recall crisis of 2014 behind it. GM has paid nearly $600 million to victims of its faulty ignition switch, including the families of 124 people who died in crashes linked to the problem.

Last year, GM reported net income of $9.7 billion, more than tripling its 2014 results. The company's profit margin reached 7.1%, up from 4.2%. GM also reaffirmed its forecast that results will continue to improve this year.

Related: Most reliable car brands

Shares of GM (GM) opened higher on the results but soon lost ground as U.S. stocks continued their recent slide.