ehemals
formerly
Expresses that something was different in the past or had a different function; earlier.
Das ehemals prächtige Schloss ist heute nur noch eine Ruine.
The formerly magnificent castle is now only a ruin.

formerly
Loading your saved state.
formerly
Expresses that something was different in the past or had a different function; earlier.
Das ehemals prächtige Schloss ist heute nur noch eine Ruine.
The formerly magnificent castle is now only a ruin.

The word is composed of 'ehe' (earlier, before) and 'mals' (an old form of 'Mal', meaning time). So it literally means 'in earlier times'.
Das Gebäude war ehemals eine Schule.
The building was formerly a school.
As an adverb, 'ehemals' (formerly) can stand at the beginning of a sentence (position 1), which leads to inversion (verb in position 2). But it can also stand after the verb inside the sentence.
Ehemals gehörte dieses Land dem König.
Formerly, this land belonged to the king.
'Ehemals' (formerly) is used mainly in written language or in a formal, narrative style. It often sounds somewhat elevated or historical.
Die ehemals mächtige Stadt ist heute ein kleines Dorf.
The formerly powerful city is now a small village.
back then
'damals' and 'ehemals' both have to do with the past. 'damals' names an earlier time: at that time, something happened or something was a certain way. 'ehemals' says more that something used to have a different role, function, or quality. It often appears with people, places, or things that have changed. Learners may confuse the words because both express 'earlier' or 'in the past'. A practical distinction is: 'damals' answers when, while 'ehemals' describes a former state.

Das ehemals kleine Geschäft ist heute ein großes Restaurant.
The formerly small shop is now a large restaurant.
Damals hatte er noch kein eigenes Handy.
Back then, he did not have his own mobile phone yet.