Nobel Prize-winning author Gunter Grass said he feared humanity was "sleepwalking" into another world war in his final interview before his death.

Grass, who died on 13 April aged 87, joined Nazi Waffen SS as a young man and after the Second World War he became a pacifist, devoting himself to exploring the guilt and trauma of post-war Germany in a series of literary works, including The Tin Drum of 1959.

In an interview with Spain's El Pais, he warned conflicts currently raging in Ukraine and the Middle East could expand unless humanity heeded the lessons of the past.

"We have on the one side Ukraine, whose situation is not improving; in Israel and Palestine things are getting worse; the disaster the Americans left in Iraq, the atrocities of Islamic State and the problem of Syria," he said.

"There is war everywhere; we run the risk of committing the same mistakes as before; so without realising it we can get into a world war as if we were sleepwalking."

In the interview, he also warned humanity faces dangers from climate change and overpopulation. He said: "All of this together makes me realise that things are finite, that we don't have an indefinite amount of time."

Grass died in a clinic in Lubeck, Germany, his publisher announced. Regarded as one of the giants of post-war German literature, he was also a respected social and political commentator.

He was awarded the Nobel Prize for Literature in 1999, with the Swedish Academy saying his "frolicsome black fables portray the forgotten face of history".