In the mid-1850s, Nicaragua was in the midst of a civil war. William Walker took advantage of that to intervene in support of one of the factions in that internal conflict. So, technically, he could claim he was not 'waging war on Nicaragua.' That was the general pattern of American filibustering expiditions ... not outright invasions, but interventions in local disputes. In reality, the local unrest provided the excuse for what was really a foreign invasion.