The U.S. has warned Americans living in or planning to travel to Kenya about possible outbreaks of violence before the country's August 8 general elections.

In a travel alert issued Thursday, the State Department said, "rallies, demonstrations, and protests may occur with little notice and even those intended to be peaceful can escalate into violence."

The alert added that "criminal elements or terrorists" could target demonstrators and visitors.

Opposition leader Raila Odinga warned in February of possible mass protests if the results of the upcoming elections are falsified.

There is a recent history of political unrest in Kenya. In 2007, more than 1,200 people were killed after political protests over a disputed poll intensified into ethnic fighting. Elections in 2013 were peaceful.