Brazilian President Dilma Rousseff recently encountered a young couple in their 30s, with a brood of young children and a hopeful outlook on the future. Until recently the father had driven a bus in Brasília, but thanks to an expansion of electricity and irrigation infrastructure, he turned previously unusable land in the countryside into a thriving vegetable farm, along with a side business raising chickens.

"How much do you make?" Rousseff asked him.

"Four times what I used to earn as a bus driver," the independent farmer responded. More money was coming in, and the costs of raising a family in the countryside are lower as well. His new goal for his children: degrees in agricultural science.

"We are wagering," smiles Rousseff, sitting in her minimalist, art-filled office in the Presidential Palace in Brasília as she recalls that conversation, "that people will be able to stand up on their own feet and walk by themselves."

Her wager--Brazil's wager--is on entrepreneurship. The past two decades have been formidable for her country: curbing inflation (by creating the real and pegging it to the U.S. dollar), privatization (notably, the state-owned telecommunication and mining companies) and a commodities boom (soybean and iron ore). Twenty years ago Brazil's GDP was at $358 billion and ranked 11th in the world; today, at $2.5 trillion, it's between sixth and eighth, depending on who's counting. No other BRIC balances democracy and widespread wealth nearly as well. Half of Brazil's population now occupies the middle class--their output alone surpasses the entire economy of neighboring Argentina. "There has been a shift, a change in the way we are [perceived]," says Rousseff, 64, whose position atop this shift now makes her the third most powerful woman in the world, according to FORBES' annual rankings.

Brazil has become one of the most entrepreneurial countries in the world, with one in four adults self-employed in some manner. Small businesses create two out of three jobs in Rousseff's private sector--Brazil's unemployment rate is an envious 5.8%--and 49% of entrepreneurs with companies less than 42 months old are women; the global average is 37%. In bustling São Paulo alone, 1.8 million small-business owners ply their trades, wares and ideas.

Technology has been a game changer. According to Nielsen, Brazil had 82.4 million Internet users in the first quarter of 2012 compared with 62.3 million three years earlier. On Facebook, Tumblr and Twitter Brazilians are the second most active social network users behind the U.S. "Technology is democratizing entrepreneurialism," says Bedy Yang, the founder of Brazilian Innovators, an organization helping young tech entrepreneurs. "There are 200 million people in Brazil and 250 million mobile devices." The Brazilian-born Yang lives in Silicon Valley and travels each month to her homeland to host monthly meetups. Three years ago you couldn't find any venture capital, says Yang, as we lurch through the clogged streets of São Paulo. "Now I'm seeing Accel Partners, Redpoint Ventures and Sequoia. It's the formation of a new asset class."

Rousseff, who took office early last year, has a plan to keep the good times rolling: incentivizing the kind of entrepreneur that Yang cultivates and that her farmer friend embodies. Specifically, lower interest rates, to expand capital; investing in infrastructure; and targeted tax cuts. "In others words," says Rousseff, "pro-growth bonuses." This on top of an already robust layer of incentives for entrepreneurs, including retirement benefits and government microloans. "The corner hairdresser, the popcorn salesperson, we also like to help them," says Rousseff, who es-pouses a program that advances up to $500 to these kinds of small operators.

The public supports her--a June poll put her approval rating at 77%, ahead of her predecessor and mentor, Luiz Inácio Lula da Silva, at a similar point in his term. Perhaps more critically, so does Brazil's entrepreneurial community. "Our government has made substantive reforms in recent years," Eike Batista, Brazil's top entrepreneur (and the world's seventh-richest man, with an estimated net worth of $30 billion), tells FORBES, "and Dilma is building a fertile environment for investors."

"I don't think I had a plan to be president," says Rousseff. That's an understatement: Rousseff's route to Brazil's entrepreneur-in-chief is as unconventional as they come.

Rousseff's father, a Communist exile from Bulgaria, made a good living in real estate and construction. His two daughters attended boarding school, where Dilma studied piano and inhaled books, a habit to this day. (Next up: James Carville's It's the Middle Class, Stupid!) "I used to play volleyball," recalls Rousseff. "My wrist is not that strong, but I could block my opponent."

In 1964, when Rousseff turned 17, Brazil's military overthrew the leftist government of João Goulart, the fifth political coup in 20 years. Overnight civil rights gave way to arrests, disappearances and torture. In 1967, unbeknownst to her family, Rousseff took the nom de guerre Estela and joined a radical faction of the Brazilian Socialist Party that preached revolt but settled for robberies and car-bombings.

Her first marriage lasted less than two years, but the second, to activist lawyer Carlos Araujo, a prominent member of the Brazilian Communist Party, would stick for nearly three decades. Araujo and Rousseff joined an activist group responsible for stealing a safe containing $2.5 million to fund political actions. Araujo has said his wife "never took up arms." (He also has said he didn't know his wife's given name until her arrest.) In early 1970 Rousseff was caught in a sting operation. Military officials tortured her for 22 days, sometimes using electric shocks, and she spent the next three years in prison.

By the time Rousseff was released in 1972, she was 20 pounds thinner and physically broken. Undaunted, she traded her radical politics for pragmatism. Rousseff pursued an economics degree, and with Araujo, now parents of a daughter, Paula, supported the Democratic Labor Party, a cooperative movement composed of leftist groups (a decade ago she jumped to the ruling Workers' Party). As her reputation grew, Rousseff landed state-level positions as Secretary of the Treasury and Secretary of Energy before serving as chief of staff for President Lula da Silva, whom she succeeded.

Rousseff rarely discusses her days as a radical and torture victim, nor does she marvel much at her improbable journey from prisoner to president. For her time and country, she says, it's typical, "the 1968 generation."