BERLIN — Otto von Hapsburg, the onetime heir to the imperial throne of Austria-Hungary, who during a long career in European politics was a strong proponent of unifying the divided continent, died Monday at his home in Pöcking, Germany. He was 98.

He died “peacefully and without pain in his sleep,” said his spokeswoman, Eva Demmerle.

Otto was the eldest son of Charles I, the last emperor of Austria-Hungary, who ruled for just under two years, until the end of World War I also brought an end to his multiethnic empire in the heart of Europe and sent the family into exile.

Otto did not, however, fit the part of the exiled would-be monarch waiting for his throne to be restored. He remained deeply involved in the turbulent events of the last century, opposing the Nazi annexation of Austria and later serving two decades as a member of the European Parliament.