Algeria forms part of the Maghreb, the mountainous farmlands along the northwest coast of Africa. Once part of the Roman Empire, it went its own way after the fall of Rome and became Muslim in the seventh century CE. In the second Millenium it formed part of the Barbary coast, notorious for its pirates. Eventually it came under the weak control of the Ottoman Empire, until French rule came in 1830. The French ruled it as part of France, just as if it were Normandy or Provence; however, the locals had fewer rights than ethnically-French settlers, which led to a growing resentment. Finally Algeria exploded into an eight-year war of independence from 1954, the winning party establishing a one-party socialist republic, depending heavily on its oil and gas reserves to pay its way.
From the 1980s onwards the rise of fundamentalism caused serious problems in the country, with terrorist train bombings in France and massacres in Algeria itself. The country was in a state of civil war in the 1990s.
Algeria's involvement in the Arab Spring was been low-key; after mass demonstrations in late 2011, the government lifted the country's state of emergency and held multi-party elections the following year. However, as the 2013 attack on a Saharan gas installation shows, Algeria is by no means out of the woods.