General Motors Co. said Thursday it posted a $1.3 billion second-quarter profit, as it prepares to sell its stock to the public, the Associated Press reported.