The US and Iran exchanged sharp accusations as nationwide protests continued, with leaders on both sides issuing warnings and counterclaims.