Hamas dominated recent Palestinian elections , but U.S. officials regard it as a terrorist organization .