He fouled international opinion when an American adventurer named William Walker invaded Nicaragua and made himself military dictator and later president. Pierce recognized the regime as legitimate.