Gonçalo Pires stares out the window of his second-floor office at a blue sky, a spectacular view of Rio de Janeiro's Ipanema beach and a distinctly sunnier economic outlook than the one he has left behind in Portugal.

"It's a pretty depressing environment there. Things are tough," said Pires, a 27-year-old native of Sintra who swapped the economic nightmare in Portugal for a slice of Brazil's boom, opening a graphic design company alongside his German business partner, 37-year-old André Koller.

"Here the market is on fire," said a smiling Pires, whose company, Vidigalo, operates out of Rio's Vidigal neighbourhood, perched on a hillside above some of the most famous beaches on Earth. "There are lots of opportunities to find work, to find clients and projects."

Pires is part of a growing wave of Portuguese migrants seeking refuge from the crunch in Brazil, where the economy grew 7.5% last year, the highest rate in more than two decades.

In contrast, the ratings agency Fitch has predicted that Portugal's economy will shrink by about 3% in 2012. Unemployment is currently 12.4% – the highest level since the 1980s.

According to government figures, the number of foreigners legally living in Brazil rose to 1.47 million in June, up more than 50% from 961,877 last December.

Leading the pack are Brazil's former colonisers, the Portuguese. Nearly 330,000 now live in Brazil, compared with 276,700 in 2010.

"This year the number of Portuguese people I've seen arriving has doubled or tripled," said Pires. A graduate of Lisbon's Catholic University, he said many former classmates were looking to Brazil and Angola, where his father and brother now work, for opportunities.

Brazil's justice secretary, Paulo Abrão, said the new arrivals – many of them highly trained professionals starved of opportunities at home – were welcome.

"Brazil has a tradition of receiving immigrants and of being an open and receptive country," he said. "Immigrants have played a central role in our country's history."

Portuguese and Spanish citizens led the trend partly because of their cultural and historical proximity to Brazil, he said.

Hugo Gonçalves, a 35-year-old Estoril-born author and journalist, relocated to Brazil in September after losing his job as a columnist for Portugal's i newspaper. He said there was a cultural connection through music, literature and even soap operas. "We are familiar with the Brazilian way of being and doing things," he said .

"I had a good job, I wrote every day for a newspaper. I was happy in Lisbon and all of a sudden I was laid off, as were many people in newspapers,. I was not going to stay in Portugal because I did not have a job, so I came [to Brazil]. And a month after I came here it really hit me that I was also a victim of the crisis."

Gonçalves, part of the generation raised after the return of democracy in 1974, said Portugal's fading fortunes had come as a shock to many of his peers.

"We had all the chances, we had more chances than our parents did. And all of a sudden at thirtysomething that is taken away," he said.

"Some did what the Portuguese have been doing for centuries: they went away. There were two or three big waves of immigration from Portugal to Brazil in the past.

"The only difference is that now the people who are coming from Portugal are educated, they have travelled. It's a different kind of immigration."

The Portuguese are not the only ones flocking to Brazil. An increasing number of citizens from Italy, the UK, the US and China are arriving too, among them engineers, executives and architects chasing opportunities in infrastructure, finance, communication and the oil and gas industry.

Since the 2010 earthquake, Haitians have also set their sights on a new life in Brazil, hoping for construction jobs in the lead up to the 2014 World Cup and 2016 Rio Olympics.

Paulo Sérgio de Almeida, the president of Brazil's national immigration council, said overseas companies were increasingly turning their sights to the Brazilian market. He pointed to a rise in the number of foreigners granted temporary work permits in Brazil, from 24,000 in 2005 to more than 56,000 in 2010.

"The crisis has meant that European companies have started directing their energies for growth into other countries … Brazil has been seeing much more vigorous growth so companies that were already here are reinforcing their presence and new companies are arriving looking for new opportunities," he said.

It is not only foreigners who are looking for a slice of Brazil's economic boom. The justice secretary said Brazilians who had left for the US, Europe or Japan in search of their fortunes were coming back, drawn by the stronger currency and better job prospects.

With little sign of the European crisis easing, Rio's newest Portuguese residents plan to stay put.

"I'm here for good – come what may," said Gonçalves, who is writing his third novel from a studio apartment in Ipanema. Enquanto Lisboa Arde, o Rio de Janeiro Pega Fogo (While Lisbon Burns, Rio de Janeiro Catches Fire) is set during the financial crisis and tells the story of a Portuguese man who, fleeing persecution and unemployment back home, embarks on a Bonnie-and-Clyde-style crime spree in Rio with his Portuguese girlfriend.

Pires – whose parents' generation abandoned Portugal in their droves to escape the Salazar dictatorship – said his contemporaries were running from a different kind of evil.

"Now we are fleeing another dictatorship: the dictatorship of banks," he said.