Charred remains of businesses burned in a recent attack by unidentified gunmen in the coastal Kenyan town of Mpeketoni on June 18. (Thomas Mukoya/Reuters)

The World Cup is about the collective. The teams on the field are their nations made real in the flesh. The stadiums and surrounding city plazas become, for a month, a vast carnival of globalization, a crossroads paved by multinational corporate sponsors and filled with eager tourists and partying soccer fans from all parts of the globe.

Even far away from the spectacle taking place in Brazil, in sleepy villages and quiet town squares, the World Cup stops activity and consumes conversation. There's no single event on the planet as important to as many people as the World Cup.

And so it's a sick, tragic fact that terrorists take advantage of the global passion for the tournament.

Earlier this week, militants linked with al-Shabab, the al-Qaeda-affiliated Somalia-based terror group, raided a coastal Kenyan town and killed some 60 people. Some of their initial targets included a group of spectators, watching the games taking place in Brazil. The next day, on the other side of the continent, a bomb ripped through a soccer-viewing venue in northern Nigeria, killing 14 and injuring dozens more. The suspected culprits belong to another notorious al-Qaeda-linked group, Boko Haram.

The Kenyan government is urging soccer fans to avoid watching the games at bars. "Where possible, Kenyans are strongly advised to watch the World Cup matches from the comfort of their homes instead of crowded and unprotected open places," read a statement from the country's interior ministry. (My colleague Harry Misiko outlines the failures of the Kenyan government that made the country all the more prone to such terrorism.)

Al-Shabab has targeted soccer fans before. In 2010, when the World Cup was staged in South Africa, it took responsibility for a series of bomb blasts in the Ugandan capital of Kampala that ripped through bars packed with World Cup watchers. Seventy-nine people died then.

Islamist extremists have ordered fatwas and frequently railed against the sinful nature of soccer, saying it encourages idle, frivolous behavior and, of course, leads its participants to wear shorts and other revealing clothing.

But the bomb blasts aren't acts of moralizing fury. They target societies at their most vulnerable — and, perhaps, at their most happy. The World Cup can bring a coastal Kenyan town to the beaches of Rio de Janeiro. It's a moment of global connection that sadly can be paid for in blood.