BEIJING - China passed legislation to retaliate against foreign sanctions, state-run media reported Thursday, as the country's tensions with the United States and other democratic nations have been escalating over human rights and security issues.