Two men have attempted to commit suicide by hanging themselves from a tree in a central Athens square, in one of the latest scenes of desperation as thousands of refugees remain stranded inside Greece after being blocked from continuing their journey.

The men, reportedly from Pakistan, forced themselves into makeshift nooses made of pieces of fabric in Victoria Square, a gathering point for refugees arriving in the Greek capital, local media said on Thursday.

Soon afterwards, ambulances arrived at the scene and took them into hospitals for treatment.

An official from Greece's National Centre for Health Operations told Al Jazeera that the two men were released from the hospitals later on Thursday in good condition.

A hospital source told Al Jazeera that the two men were believed to be brothers, but that could not be independently verified.

A police spokesperson also confirmed to Al Jazeera that the two men were in good health. He said the men were "probably" from Pakistan, but added that that had not been verified as they did not have any documentation on them.

"It [the suicide attempt] happened at midday in Victoria Square," the police spokesperson told Al Jazeera. "They probably wanted to show their objection to the fact that they cannot leave [Greece]."

Yiannis Chatzidakis, a psychiatrist with Klimaka, a suicide prevention NGO that runs a helpline in Greece, said the refugee crisis in the country was deteriorating.

"I am not surprised by the fact that people who are under such psychological pressure can commit such desperate acts," Chatzidakis told Al Jazeera.

"The situation is increasingly becoming worse ... so I don't find it strange that hopeless people with no home are willing to attempt to cut razor-wire fences or even commit acts [like the one today] - irregardless if they have mental health issues or not."

Thousands of refugees have been trapped in Athens and on Greece's northern border, after the government in Skopje severely restricted the number of people it allows to cross their border.

This followed a decision by countries further up to turn back groups of refugees who are not from Syria or Iraq.

Greece has seen about a million arrivals of refugees since January 2015.

This year, more than 100,000 people have so far crossed the Mediterranean to Greece and Italy, and 413 have lost their lives trying, the International Organisation for Migration (IOM) said on Tuesday.

With 3,771 deaths, 2015 was the deadliest year on record for migrants and refugees crossing the Mediterranean trying to reach Europe, according to the IOM.

Follow Teo Kermeliotis on Twitter: @Teo_Kermeliotis