Dozens of people rescued from a capsizing boat in the Mediterranean Sea have been brought ashore in Malta, hours after the government had said no further groups would be allowed in after it shut its ports due to the coronavirus pandemic.

The 64 migrants were rescued early on Friday by the Maltese armed forces from a boat inside the Malta rescue zone south of the island.

On Thursday, Malta had followed Italy, the country that has so far recorded the most deaths from COVID-19, in announcing it would no longer allow migrant boats to land due to the risk of infection.

The Maltese government said in a statement the armed forces had been monitoring the migrants for some hours before a patrol boat picked them up.

However, it said Malta could not guarantee further rescues and would not allow any further disembarkation of rescued people because resources have been strained by the pandemic.

The new arrivals were received by soldiers wearing bio-suits shortly after midnight. They will be kept in detention.

"It is in the interest, and is the responsibility, of such people not to endanger themselves on a risky voyage to a country which is not in a position to offer them a secure harbour," the government said.

'Human rights obligations'

In a joint statement, 13 NGOs working with migrants and refugees said they are "shocked" by Malta's announcement.

"It is unacceptable for Malta to exploit the COVID-19 pandemic to shelve its human rights obligations and endanger the lives of men, women and children," the statement read.

"Whilst we appreciate Malta's current challenges, we nonetheless insist that migrants must not be sacrificed for the nation's well-being. National emergencies should be overcome with solidarity and compassion," it continued.

"We therefore urge Malta to ensure the rescue and disembarkation of persons within its responsibility and to revise the situation of hundreds of detained persons."

Malta has imposed a 14-day quarantine on all travellers entering the country, closed schools and told people to stay at home during the emergency.

It announced this week its first death from COVID-19, and had 319 active cases as of Thursday, according to government figures.

After a relative lull in arrivals of boat migrants from Africa, numbers had started to pick up again in the first two months of the year only to fall back sharply in March as Italy was hit by the pandemic.

Meanwhile, war-torn Libya's internationally recognised government in Tripoli declared its seaports unsafe for the disembarkation of migrants.

In a statement on Thursday, the International Organization for Migration (IOM) said some 280 migrants who were intercepted and returned to the country remained on an overcrowded coastguard vessel as Libyan authorities refused to let them come ashore.

"Relevant officials have indicated that due to the intensity in shelling, some of which previously targeted the Tripoli main port, Libya is not considered a safe port," the IOM said.

Before the crisis, ships operated by aid groups regularly patrolled the coast of Libya looking to rescue migrants from flimsy boats. Most have withdrawn but one ship operated by German charity Sea-Eye returned to the area last week.

With both Italy and Malta, the two nearest European countries, closed, it is unclear where they will be taken.