The bus, which was carrying 55 people, rolled down a steep hillside after veering off the road on a bend east of the capital, Funchal, and struck at least one house, local mayor Filipe Sousa told cable news channel SIC.

The dead included 18 women and 11 men, one of whom died later at a hospital, Mr Sousa told public broadcaster RTP.

Portuguese foreign minister Augusto Santos Silva said preliminary reports he had received indicated all the dead were German.

But Tomasia Alves, head of the Funchal hospital, said not all the victims had been identified and refused to confirm the nationality of the dead.

Pedro Calado, vice president of Madeira's regional government, said at a news conference that the injured, including the Portuguese driver and a local tour guide, were taken to a hospital.

He did not say whether anyone who was not on the bus, including people on the roadside at the time of the accident, were among the victims.

No children were among the dead and injured, Ms Alves said.

She said at a news conference that two of the injured were Portuguese and the rest were foreign, but she declined to give further details.

The mayor said the bus was carrying a group of German tourists.

The German foreign ministry, in a tweet, expressed "great shock" at the accident.

"We must unfortunately assume that victims are from Germany," it said.

Portuguese prime minister Antonio Costa said in a tweet that he had sent condolences to German chancellor Angela Merkel. "I learned of this tragic accident in Madeira with deep sorrow," he said.

Ms Merkel's spokesman said "terrible news is reaching us from Madeira".

Steffen Seibert said on Twitter that "we are in deepest sorrow over all those who lost their lives in the bus crash." He added: "Our thoughts are with the injured."

Portugal's air force said it had three aircraft on standby in case any injured needed to be taken to hospitals on the Portuguese mainland, almost 600 miles away.

But Funchal hospital's clinical director, Dr Pedro Freitas, said transfers were not necessary.

Madeira's regional government announced three days of mourning, when flags on public buildings are flown at half-staff.

Residents said the weather was fine at the time of the accident, which happened in daylight in the early evening.

Calado, the regional government's vice president, said the bus was five years old and had passed its mandatory inspections for roadworthiness.

Authorities said they were investigating the cause of the crash.