sentences:  With an eye on the events of the American Revolution forty years earlier, revolutionary leaders began bloody wars of independence against Spain, whose armies were ultimately unable to maintain control.By 1831, Spain had been ejected from the mainland of the Americas, leaving a collection of independent republics that stretched from Chile and Argentina in the south to Mexico in the north.Spain's colonial possessions were reduced to Cuba, Puerto Rico, the Philippines and a number of small islands in the Pacific, all of which she was to lose to the United States in the 1898 Spanish–American War or sell to Germany shortly thereafter.