One of the most decisive factors in shifting US opinion towards war with Spain, and involvement in the Cuban War of Independence, was the sinking of the USS Maine.
The Maine was officially sent to Cuba to protect the lives and property of Americans living there. Receiving the permission of the Spanish, the Maine left for Cuba in January 1898.
The captain and crew were well received by the Spanish. Dinners and parties with all the proper formalities took place as usual aboard the ship and all seemed to be going well. That suddenly changed the night of February 15, when the Maine exploded in Havana harbor. 258 American sailors were killed and many more injured. The captain and many officers were off boards at the time.
Instantly, the American media picked up the story and blamed the Spanish. The public, and Assistant Secretary of the Navy Theodore Roosevelt, quickly accepted this assessment.. Captain Sigsbee, however, was doubtful.
Both the Spanish and American governments investigated the explosion. Neither could produce reasonably conclusive evidence, and each blamed the other. The Spanish said it was an accident, and while the US didn't rule this out, they said the Spanish somehow caused it.
Assuming the explosion was not an accident, there are three main suspects: Cuban rebels, an American agent, or the Spanish. Little or no evidence has ever been found to link any particular individuals to the actual act of destroying the ship, but many had motives.
Some of the Spanish officers didn't like the Americans and resented their presence, especially militarily. However, with a their empire crumbling and power waning fast, it is doubtful that they would have wanted the U.S. as an enemy.
Some have also suggested that the Cuban rebels destroyed the ship. For many years they had been trying to get US recognition, but never received it. Perhaps they predicted that in destroying the Maine, Spain would be blamed, and the US would enter the war on the Cuban side.
The last suspects are Americans. The sensationalist US press greatly benefited from the war, and media sales (mainly in newspaper form) rose sharply after the destruction of the Maine. Also, many expansionist-minded Americans were anxious to test their newly outfitted military. Thus, several major groups of Americans had motives to instigate a war with Spain.
Many years later an investigation with modern technology was done by an American company, which concluded that an internal explosion destroyed the ship (implying an accidental explosion). Nevertheless, the American public largely blamed the Maine's destruction on Spain and supported the declaration of war against Spain.