Finance Minister Jim Flaherty said in an email that the shares were sold at Tuesday's closing price of US$37 on the New York Stock Exchange, minus a small discount.
With completion of the sale, the governments will continue to hold more than 119 million GM common shares and 16.1 million GM series A preferred stock through a federal agency.
Both Ottawa and the Ontario government acquired GM shares in 2009 after having provided the ailing automaker with some $10.6 billion in aid during the Great Recession.
The investment is held on behalf of the two governments by Canada GEN Investment Corp., a subsidiary of the Canada Development Investment Corp.
The Ontario government announced it was divesting its interest in 10 million GM shares, while Ottawa was selling 20 million shares through the transaction announced Tuesday.
"In the worst of the global recession, we took the necessary action to protect Canadian jobs and communities with a co-ordinated investment in GM and Chrysler, along with the Ontario and U.S. governments," the statement issued by Flaherty's office said.
"The financial support was crucial in protecting jobs and positioning Canada's auto industry for future success."
"As we said from the start, our investment in GM was always meant to be temporary as we worked to maximize the return to Canadian taxpayers," Flaherty said.
The finance minister added that Ottawa was committed to selling its remaining ownership of GM "as quickly as feasible."
Ontario Finance Minister Charles Sousa also said the province was "committed to exiting from its remaining interest in the GM shares, while maximizing the value of the government's interest for the people of Ontario."
Sousa said Ontario would hold almost 36.7 million GM common shares and 5.4 million series A preferred Stock.
The U.S. government is also getting closer to selling all of its General Motors stock.
The Treasury Department said in its August report to the U.S. Congress that it sold $811 million worth of GM common stock last month.
The report dated Tuesday said the government has recovered about $35.4 billion of the $49.5 billion bailout it gave the Detroit automaker. That means American taxpayers are still $14.1 billion in the hole.
— With files from The Associated PressSuggest a correction