"The believers should not take the disbelievers as allies," meaning: in terms of seeking counsel, "instead of the believers. And whoever does that has nothing to do with Allah, except if you seek to protect yourselves from them as a precaution (tuqah)."
Yahya narrated from Al-Furat ibn Salman, from Abd al-Karim al-Jazari, from Abu Ubayda ibn Muhammad ibn Ammar ibn Yasir, who said: "The polytheists captured my father and did not let him go until he insulted the Messenger of Allah (peace be upon him) and spoke well of their idols; then they released him. When he came to the Prophet (peace be upon him), he said: 'What is behind you (what is your situation)?' He replied: 'Evil, O Messenger of Allah! By Allah, I was not released until I disparaged you and spoke well of their idols!' He (the Prophet) said: 'How do you find your heart?' He replied: 'I find it tranquil with faith.' He said: 'If they repeat it, then you repeat it.'"