HONG KONG - China was prompted to seek a national security law on Hong Kong by its need to deter foreign forces from taking control of the former British colony, according to a pro-Beijing local legislator.