Nicaragua was dominated by three tribes prior to the arrival of the Spanish in the 16th Century. For much of the next three hundred years the country was dominated by the Spanish apart from a period when it was part of the Mexican Empire.
In 1821 the country gained independence as the United Province of Central America. In 1912 the country was occupied by US Marines who stayed until 1933 when they were driven out during a guerrilla war led by Augusto César Sandino who was subsequently executed in 1934.
By 1936 the Somoza family had seized control of the country and gradually built their regime into a dictatorship which lasted until 1979.
In 1961, however, the Frente Sandinista de Liberacion Nacional (FSLN) were founded, taking their name, the Sandinistas, from Sandino. They fought a brief war but were beaten back by the US supported Somoza family.
In 1974 there was a new uprising and this time the Sandinistas, supported by Cuba and Russia, developed the campaign into a full scale civil war. The Somozas were eventually driven out and a new government was proclaimed on 19th July 1979 under the leadership of Daniel Ortega.
In the 1984 general election Daniel Ortega was elected president with 66.97% of the vote, whilst the FSLN took 61 of the 96 seats in the National Assembly.
From 1979 onwards, remnants of the former National Guard, who had fought the Sandinistas under Somoza, regrouped and started a guerrilla war under the title the Contras, supported by the United States. Although legislation was passed in 1982 which prevented the sale of arms by the US to the Contras, a method was found by some officials which saw the sales of arms to Iran paying for illegal supplies to the Contras. When the affair broke in 1986 it was known as the Iran-Contra Affair.
Fighting each other into a standstill, both sides finally signed the Sapoa Ceasefire Agreement on 23rd March 1988.
In an election on 25th February 1990 the FLSN surprisingly lost to the National Opposition Union, an alliance of opposition parties. Violeta Barrios de Chamorro of the Union won the presidential election with 55% of the vote.
In 1996 the election was won by the Liberal Alliance which subsequently became the Constitutional Liberal Party (PLC) and the presidential election was won by their candidate Arnaldo Alemán.
In 2001 the PLC won once more, taking 49 seats in the 92 seat National Assembly and their candidate, Enrique Bolaños became the new president.
After fifteen years in opposition, Daniel Ortega won the 2006 presidential election with 38.07% of the vote and the FLSN was the largest party in the 92 seat National Assembly with 38 seats.
The President and Vice President are elected on the same ticket by popular vote for a five year term.
The unicameral National Assembly has 92 seats. Members are elected by proportional representation and party lists to serve five-year terms. There is one seat for the previous President and one seat for the runner-up in the previous Presidential election.
The Transparency International Corruption Perceptions Index (CPI) 2016 places the Nicaragua at joint 145th out of 176 countries with a CPI 2016 score of 26 (where 100 is least corrupt).