What did Spain and the U.S. agree to do?