Brazilian voters have elected their first female head of government, a woman running for elected office for the first time.

Dilma Rousseff's story is intertwined with the last half-century of Brazil's history. She is the daughter of an immigrant, and has been a guerrilla, a torture victim, an economist, an energy minister and the president's chief of staff.

Rousseff was born in Belo Horizonte, a state capital north of Rio de Janeiro, in 1947. She is named after her mother, a schoolteacher from a ranching family.

Her father, Pedro Rousseff, was a political exile from Bulgaria, where he had been a member of the Communist party in the 1920s. In Brazil he became a successful businessman.

pt-rally-9481226

Supporters of Workers Party presidential candidate Dilma Rousseff wave flags during a campaign rally in Sao Paulo, Brazil, Sept. 27. ((Andre Penner/Associated Press))

Dilma's early education was at a boarding school run by nuns, with French the language of instruction. Her political awakening began after she transferred to a public high school.

High school and the 1964 coup

In 1964, Brazil's military overthrew the leftist government of Joao Goulart, in office since 1961. It was the fifth political intervention in 20 years by Brazilian military officers, but this time they would stay in power for 21 years. The coup was supported by the U.S. government.

Under the military dictatorship civil rights were suspended and arrests, disappearances and torture became commonplace. Education's share of the government budget was cut in half.

At high school Rousseff was influenced by the writings of French political theorist Régis Debray and by a teacher and future comrade who taught her Marxism.

The school was a centre of student activism against the dictatorship. In 1967 Rousseff joined a radical faction of the Brazilian Socialist Party.

A number of her fellow activists from this period are also politicians today. Carlos Minc is the environment minister. Fernando Pimentel is a former mayor of Belo Horizonte and a Rousseff adviser. Jose Anibal is a federal deputy representing the party of Rousseff's presidential opponent, Jose Serra.

She also met Claudio Galeno Linhares, a journalist and fellow activist, whom she married in 1968.

Armed struggle

Their political faction, known by the acronym Polop in Portuguese, split and they became part of a faction that favoured armed struggle against the dictatorship. It soon joined with other militant groups to form Colina (National Liberation Command).

brazil-military2005-rtr6m0g

Retired Brazilian Army officers stand near crosses they placed on the lawn in front of Congress in tribute to soldiers killed fighting leftist guerrillas and civilians killed in bomb attacks in Brazil between 1966 and 1974, in Brasilia, March 31, 2005. The tribute was held on the 41st anniversary of the military coup that brought into power the dictatorship that ruled the country from 1964-1985. ((Jamil Bittar/Reuters) )

The small Colina group in Belo Horizonte carried out bank robberies, car thefts and a couple of bombings. In January 1969, during a police raid on a Colina house, two policemen were fatally shot and one was wounded.

Rousseff and Galeno fled to Rio de Janeiro. Galeno later went into hiding in Porto Alegre in southern Brazil while Rousseff remained in Rio, where she met Carlos Araujo, a lawyer and leftist militant. Araujo told the newspaper O Globo in October that it was "love at first sight," as Rousseff was beautiful, intelligent and "devoted to political struggle." Her split with Galeno was amicable.

Rousseff and her comrades would go through more mergers and divisions of their small militant groups, with Rousseff ending up in Sao Paulo.

Arrested and tortured

That's where she was arrested in 1970 after unexpectedly showing up at a bar where a colleague was being arrested in a police sting operation.

According to Araujo, "Dilma never took up arms." He says he only learned his lover's real name because of her arrest. Seven months later he too was arrested.

dilma1970-rtxskf0

A police mugshot of Dilma Rousseff from 1970. She was arrested in Sao Paulo on Jan. 16, 1970. ((Reuters))

Rousseff endured 22 days of torture, including electric shock and a special device of the Brazilian military known as the pau de arara, designed to cause severe joint and muscle pain.

Her sentence was six years of imprisonment and 18 years without political rights. The sentence was later shortened to three years, and she was released in 1973.

A child, a degree, a return to politics

Soon after her release she moved to Porto Alegre, where Araujo is from and where he was imprisoned until 1974. Rousseff returned to studying economics, graduating in 1977.

In 1976 she gave birth to Paula Rousseff Araujo, her only child (now a lawyer). Around this time Galeno returned from political exile, and with his new partner lived in the same house as Araujo and Rousseff.

Rousseff lost her first job because of her subversive past and returned to university to pursue a master's degree.

In the early 1980s, as the generals loosened their grip on the country, Rousseff and Araujo became active in the PDT (Democratic Labour Party), led by Leonel Brizola, brother-in-law of Joao Goulart, overthrown in the 1964 coup.

The PDT won elections, and Rousseff held a series of jobs as an adviser and bureaucrat at the local and state level. In 1993 the state governor of Rio Grande do Sul appointed her secretary of energy.

She left that post the next year, as well as her relationship with Araujo after discovering another woman was pregnant with his child. They reconciled two years later but broke up again in 2000.

Without having completed her master's degree, Rousseff enrolled in a PhD program but that too was interrupted. In 1999 she was appointed to her old job, now called Secretary of Mines, Energy and Communications.

Jump to Workers' Party

The governor, Olivio Dutra, was from the Workers' Party but Rousseff was a member of the PDT. Her party leader, Brizola, pressed the PDT ministers in the state government to step down. Instead, Rousseff left the PDT and in 2001 joined the Workers' Party, led by Luiz Inacio Lula da Silva, best known by his nickname, Lula.

Dutra told Reuters in September that Rousseff had worked well with the private sector at extending the state's power grid and avoiding blackouts that plagued the rest of Brazil, but "nobody thought — not even her — that she would ever be a major candidate for anything."

Rousseff left government in 2002 to work on Lula's successful campaign for president. Once in office, he named her minister of mines and energy.

dilma-lula2004-rtrinq1

Brazilian President Luiz Inacio Lula da Silva shares a light moment with his Mines and Energy Minister, Dilma Rousseff, during a ceremony in Brasilia, Dec. 20, 2004. ((Jamil Bittar/Reuters))

In 2003 Brazil was still reeling from electricity shortages, caused by a drought that affected hydroelectric dams and by decades of underinvestment in energy sources. Electricity rationing was widespread.

Rousseff had frequent clashes with Environment Minister Marina Silva, as Rousseff sought successfully to increase Brazil's power capacity. Silva ran against Rousseff for president in the first round of voting, as the candidate of the Green Party.

Chief of staff

In 2005 a scandal forced the resignation of Lula's chief of staff, and he appointed Rousseff to that post. A few years later speculation began that Rousseff would be Lula's choice to succeed him as president.

dilma2009-rtxs2l5

Dilma Rousseff, then the Brazilian president's chief of staff, shows her natural hair, after undergoing cancer treatment, during a launching ceremony of the Human Rights National Program in Brasilia, Dec. 21, 2009. ((Roberto Jayme/Reuters))

Then in 2009 Rousseff was diagnosed with lymphoma, which was treated with chemotherapy.  After tests in August, cancer specialists in Sao Paulo pronounced her "cured of the lymphoma."

Rousseff told Reuters that Lula started to "joke around" about the possibility of her presidential run. This, she said, is "the only way that someone who is not thinking about becoming a candidate will get used to the idea."

In February, she began her first run for elected office. With little name recognition and without experience as a candidate, her campaign presented her as the one to continue Lula's largely market-friendly policies and social welfare programs. She told voters that she was "going to follow Lula's path."

Lula — prevented by Brazil's constitution from seeking a third presidential term — remains hugely popular and frequently campaigned with Rousseff.

There is little expectation that Rousseff as president will be as popular as Lula, and her many challenges include continuing the tremendous economic growth that Brazil has been experiencing.

Rousseff's inauguration happens Jan. 1.