No group immediately claimed responsibility for what Iranian state media called a “terroristic” attack.