The incident happened near the disputed Scarborough Shoal and Beijing said it acted "in accordance with the law".