DETROIT — General Motors Co.’s CEO said yesterday that the automaker has repaid the $8.1 billion in loans it received from the US and Canadian governments, a sign that a plan to rebuild the company is working.

GM got a total of $52 billion from the US government and $9.5 billion from the Canadian and Ontario governments as it went through bankruptcy protection last year. The United States considered as a loan $6.7 billion of the aid, while the Canadian governments held $1.4 billion in loans.