This week Toomas Hendrik Ilves flew into Britain for meetings with David Cameron and an appearance with more than 60 other world leaders at the London Conference on Cyberspace. Ilves is the president of Estonia, the smallest and most successful of the Baltic states, and he knows a thing or two about the digital world, having orchestrated the ambitious "wiring" of what has been called "E-stonia". He knows more than most about cyber-security, too, having seen his country's computers crash en masse in 2007 following a cyber-attack that many (including Ilves) allege is traceable to Vladimir Putin's Russia.

I am following the Estonian leader's visit more closely than most; he had been an old friend of mine back in high school, 40 years ago. He relates details of the recent digital intrusion – purportedly sparked by his decision to relocate a 1947 memorial to Soviet war dead from a park in Tallinn, which angered some ethnic Russians living in Estonia's medieval walled capital – when I visit him at his family farm, near Abja Parish, some 40 miles inland from the Gulf of Riga.

My sojourn to the president's remote, bucolic residence, where he lives with his wife, Evelin Int-Lambot, and their daughter, has been made possible by our relationship when he was serving as the vice-president of the high-school student council in Leonia, New Jersey, US. A skilled politician even then, this tall, long-haired 16-year-old – with a penchant for jeans and tweed sports jackets – managed, while attending to his official duties, to humour an argumentative cadre of awkward first-year student loudmouths whose pimpled number included me. (Forty years later, still tall and lean but minus most of the hair, Ilves' sartorial signature is the bow tie.)

And though my friends and I were unaware, Ilves' parents had fled their Estonian home in 1944 when the country was retaken by the Russians after four years of Nazi occupation; the 81-hectare farm his family had lived on since 1763 was confiscated. They ended up in a leafy suburb of New York City, after they had first evacuated to Sweden. Their eldest son was born in Stockholm on Boxing Day 1954, and grew up, despite a strong Estonian identity, as an American teenager. The highest achiever of Leonia High's Class of 1972, "Tom" Ilves gave young classmates rides in his family's Plymouth station wagon and introduced me to a peppy little combo from Los Angeles that had just released their first album. Back then they were called, simply, Eagles.

Since then an innate skill at building unlikely coalitions has served Ilves well. When Estonia's parliament re-elected him in August to a second five-year term, the currently unaligned 57-year-old president enjoyed the support not only of his old party, the governing centre-right Reform party, but also the conservative Union of Pro Patria and Res Publica, and the out-of-power Social Democratic party to which he once belonged. Ilves today is a pro-western moderate, and apparently in step with the majority of Estonians.

His popularity results in part from the robustly healthy state of the Estonian economy through the global downturn – 8.8% GDP growth in the second quarter of this year – a function, Ilves says, of the prudent course the country has adhered to in recent years, trimming its spending and keeping a lid on borrowing. He also acknowledges the inevitable growth that accompanied transition to a market economy. "Like the rest of eastern Europe, there was no service sector at all to speak of under communism. You didn't have restaurants. There was no choice. Basically, it was like you had State Haircut Facility Number 347. So that had to change."

He also secured the country's entry into Nato and its recent admission to the eurozone, which has increased its standing in the west, and Ilves' stature at home, as he pushed strongly for both in a country where neither was initially wildly popular. He has been a vigorous advocate for technology – it's virtually impossible not to find free wireless access on my travels.

When we meet for the first time in 25 years, Ilves fills in the missing details of his life. After two psychology degrees, a directorship of a Vancouver art centre, and teaching at an "alternative high school" in New Jersey, his knowledge of Estonian and disenchantment with mainstream psychiatry led him to find work at the Baltic desk of Radio Free Europe, the US-funded service that beamed western views – typically not unadjacent to those of the CIA – into eastern bloc states.

"Speaking Estonian put me at a real advantage," Ilves says. He remains unsurprised that the hawkish Reagan administration would install a putative pinko in this role. "I was too lowly for anyone to care; I wrote research papers about Estonia, in grammatical English, and that made me the research department. The Poles had 30 people on their desk, the Czechs 15, Estonia one. Besides, liberal democracy was my agenda then. And it still is.

"Then in 1988, the broadcast side had big personnel problems. So they picked me up by the scruff of the neck and said: 'OK, run this for a while until we figure out what we're doing.' Then all hell broke loose [in the USSR] and it became much more exciting to be talking to Estonia."

For reasons unknown, in November 1988, Estonia's Supreme Soviet bureaucracy granted Ilves a visa to travel to the land of his parents' youth, where he had been floating pro-US propaganda over the airwaves. He was warmly received, his presence widely covered.

Ilves was well situated then to access Estonia's new halls of power when independence came and the need to build democratic institutions was urgent and acute. "I had become one of the few Estonians who knew anything about foreign policy. And the president said: 'I want you to become the ambassador to the United States because we need someone who can deal with the US.'" In 1993, Ilves formally renounced his US citizenship – a job requirement – and relocated to Washington DC.

Serving next as his country's foreign minister, Ilves was then elected a member of the European parliament. In 2006, he became Estonia's third post-cold war president. The role is technically ceremonial; Estonia's constitution concentrates more power in the hands of its prime minister (Andrus Ansip, leader of the Reform party since 2005), with whom Ilves remains allied. But he is the most visible international face of a country that this year celebrates 20 years of independence from Soviet rule.

Some Estonians have complained about Ilves's Swedish and American roots, but these have not been insurmountable obstacles. The country joined the eurozone on 1 January this year and enjoys one of its most robust economies. Ilves argued that his country needed to join Nato and that EU membership was the necessary foundation. "We live in a bad neighbourhood. Being invaded by a big neighbour to the east is scary ... I realised that if we were not in the EU there were people in the EU who were also members of Nato that would veto our joining Nato." (His country's willingness to supply troops to the war efforts in Iraq and Afghanistan may have paid off, too. Estonia has universal conscription, but service in these war zones was voluntary. And though it sent only 40 troops to Iraq, and 170 to Afghanistan, this placed Estonia, on a per capita basis, among the coalition's most willing participants.)

I remember Ilves as a world-class Richard Nixon-hater, but the Estonian president has kind words for one of Nixon's Republican successors, George W Bush. "We had really good conversations. You know, it wasn't, 'Golly, gee, them Commies are bad.' It was very serious. He knew what he was talking about."

Obama, on the other hand, "is not as engaged with Europe. It's not even Obama the man. I think it's the fundamental change in the United States – Europe is not a strategic problem to be solved, the way it was from the end of the second world war until Nato enlargement in 2005. Now it's like, 'OK, now we have other problems. We have China. We have al-Qaida.' That's the American mentality: Problem solved.

"I can see where you could think that. There's no Soviet threat. You're not going to see the Estonians or the Czechs or the Poles descend into failed statehood. But I would say that the European Union is really a fundamental partner, or should be, for the United States insofar as it's on the same side of the ideological page.

"The competing model today is authoritarian capitalism, countries that are formerly communist or nominally communist, where they basically say, 'You can make money, but you can't have freedom of speech and you can't have freedom of the press' … Our model is more efficient because we make autocratic decisions, and that works much better than this messy democracy stuff."

He adds: "In the short term, you probably can make more efficient decisions. That was the argument for Adolf Hitler and fascism. But I don't think in the long term it's sustainable. Democracy is messy, clearly, but it has one key factor, which is an orderly transfer of power. And that's the problem with all these authoritarian countries – they become corrupt, and then the guys at the top want to grab it all. But then the problem is that you have to stay in power until you die because if you give up power, all [your wealth] will be confiscated and you'll be put in jail. Or worse."

Though I'm not sure I disagree with anything Ilves has said, hearing the former student radical defend western capitalism makes me feel old. This was, after all, the parliamentarian who allowed some of us to put forward a quixotic resolution advocating an end to all high-school French lessons until the US withdrew from Vietnam. So I am grateful when our conversation ends on a note more critical of developments in the US, and Ilves' prediction that the country will pay a price for its increasing number of have-nots.

"In both Russia and the US there are a very small number of very, very rich people, and then there are a lot of people who don't have anything. The less inequality you have in a society, the more social peace you have. It's kind of a no-brainer."

It's time to go. My next stops are neighbouring Lithuania and Latvia, where I learn from some English-speaking local women that he is not only a respected politician but also something of a regional sex symbol. Not bad for a guy from New Jersey.