Sri Lanka has declared a state of emergency for 10 days to contain the spread of communal violence, a government spokesman said on Tuesday.