A 23-year-old and a 22-year-old, both from Bristol, were held under the public order act on suspicion of inciting racial or religious hatred.
Complaints were made to Avon and Somerset police about remarks made on the social networking site on Wednesday, which were said to be of a racist or anti-religious nature.
Detective Inspector Ed Yaxley said: “On Wednesday evening, we were contacted by people concerned about comments made on social media accounts.
“We began inquiries into the comments and at around 3.20am two men, aged 23 and 22, were detained at two addresses in Bristol.
“The men were arrested under the public order act on suspicion of inciting racial or religious hatred. Our inquiries into these comments continue.
“These comments were directed against a section of our community. Comments such as these are completely unacceptable and only cause more harm to our community in Bristol.
“People should stop and think about what they say on social media before making statements as the consequences could be serious.”
Police confirmed the two men were later released on bail pending further inquiries.
Concerns have been raised about comments made on social media, including those directed against the Muslim community.
On Thursday, the Islamic Human Rights Commission wrote to Bernard Hogan-Howe, the commissioner of the Metropolitan police, asking for vigilance in prosecuting those who “incite murder or hatred” on Twitter.
Chair of IHRC, Massoud Shadjareh said, “Muslims are justifiably scared at the moment, as there is a backlash taking place, mosques have been attacked and threats towards Muslims are common on social media, we call on the police to protect communities from any sort of racist or Islamaphobic attack.”