US intervention during the Spanish-American War in 1898 assisted the Cubans in overthrowing Spanish rule .